|
|
|
@ -248,9 +248,10 @@ Object.entries(episodeExtra).forEach(([id, { slug }]) => {
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
export async function getEpisodes() {
|
|
|
|
|
const feedRes = await fetch('https://feeds.buzzsprout.com/1764837.rss', { next: { revalidate: 60 * 10 } });
|
|
|
|
|
const feedRes = await fetch('https://feeds.buzzsprout.com/1764837.rss', { cache: 'no-store' }); // { next: { revalidate: 60 * 10 } }
|
|
|
|
|
|
|
|
|
|
const feedString = await feedRes.text()
|
|
|
|
|
/* const feedString = fs.readFileSync('./feed.rss').toString() */
|
|
|
|
|
// const feedString = fs.readFileSync('./feed.rss').toString()
|
|
|
|
|
|
|
|
|
|
let feed = await extractFromXml(feedString,
|
|
|
|
|
{
|
|
|
|
@ -272,6 +273,7 @@ export async function getEpisodes() {
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const numEpisodes = feed.entries.length;
|
|
|
|
|
console.log('---------------- numepisodes: ', numEpisodes);
|
|
|
|
|
const feedEntries = feed.entries.map(
|
|
|
|
|
({ id, title, description, enclosure , published, content, chapters, duration }, i) => ({
|
|
|
|
|
num: numEpisodes - i,
|
|
|
|
@ -315,6 +317,7 @@ export async function getEpisodes() {
|
|
|
|
|
: feedEntries;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* export async function getEpisodesLocal() {
|
|
|
|
|
* const dbEpisodes = await db.all('select * from episodes order by number desc;');
|
|
|
|
|
* return dbEpisodes.map(({ title, pub_date, summary: description, content, slug, duration, filename, number, episode_type, buzzsprout_id, buzzsprout_url, youtube_url, transcript_filename }) => {
|
|
|
|
|