Highlights: auto-fill episode audio from the feed by season + episode number; v2.46.1
Publish Container / build (push) Successful in 15m38s
Publish Container / build (push) Successful in 15m38s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
30a7e8a6cb
commit
03c3dd72fe
2 files changed
+12
-7
No files matched your search
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "siteforge",
|
"name": "siteforge",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "2.46.0",
|
"version": "2.46.1",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
+11
-6
@@ -4,7 +4,7 @@ import { loadPodcastWorkflow, laneSeasonOf } from './routes/podcast-workflow.js'
|
|||||||
// The Spotify (Anchor) RSS feed only lists episodes that are live, so a season + episode number
|
// The Spotify (Anchor) RSS feed only lists episodes that are live, so a season + episode number
|
||||||
// showing up there means the episode has been published. That drives two things on the public site:
|
// showing up there means the episode has been published. That drives two things on the public site:
|
||||||
// - highlights marked "hold until released" stay hidden until their episode is in the feed
|
// - highlights marked "hold until released" stay hidden until their episode is in the feed
|
||||||
// - study lessons with no audio of their own pick it up from the matching feed episode
|
// - highlights and study lessons with no audio of their own pick it up from the matching feed episode
|
||||||
|
|
||||||
const SNAPSHOT_TTL_MS = 5 * 60 * 1000
|
const SNAPSHOT_TTL_MS = 5 * 60 * 1000
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@ export async function applyFeedRelease(content) {
|
|||||||
|
|
||||||
const links = Array.isArray(content.podcastFeaturedLinks) ? content.podcastFeaturedLinks : []
|
const links = Array.isArray(content.podcastFeaturedLinks) ? content.podcastFeaturedLinks : []
|
||||||
const studies = Array.isArray(content.studies) ? content.studies : []
|
const studies = Array.isArray(content.studies) ? content.studies : []
|
||||||
if (!links.some(l => l?.holdUntilReleased) && studies.length === 0) return content
|
if (links.length === 0 && studies.length === 0) return content
|
||||||
|
|
||||||
const [index, wf] = await Promise.all([getFeedIndex(), loadPodcastWorkflow()])
|
const [index, wf] = await Promise.all([getFeedIndex(), loadPodcastWorkflow()])
|
||||||
const seasonA = laneSeasonOf('A', wf, content)
|
const seasonA = laneSeasonOf('A', wf, content)
|
||||||
@@ -52,11 +52,16 @@ export async function applyFeedRelease(content) {
|
|||||||
|
|
||||||
const nextLinks = links.flatMap(link => {
|
const nextLinks = links.flatMap(link => {
|
||||||
// General highlights aren't tied to a series, so there's no season to match against
|
// General highlights aren't tied to a series, so there's no season to match against
|
||||||
if (!link?.holdUntilReleased || link.lane === 'general') return [link]
|
if (!link || link.lane === 'general') return [link]
|
||||||
const season = link.lane === 'second' ? seasonB : seasonA
|
const season = link.lane === 'second' ? seasonB : seasonA
|
||||||
const item = season && link.episodeNumber ? index.get(`${season}-${link.episodeNumber}`) : null
|
const item = season && link.episodeNumber ? index.get(`${season}-${String(link.episodeNumber).trim()}`) : null
|
||||||
if (!item) return []
|
if (!item) return link.holdUntilReleased ? [] : [link]
|
||||||
return [{ ...link, url: link.url || item.link || '' }]
|
// Highlights with no audio of their own pick it up from the matching feed episode
|
||||||
|
return [{
|
||||||
|
...link,
|
||||||
|
url: link.url || item.link || '',
|
||||||
|
embedUrl: link.embedUrl?.trim() ? link.embedUrl : (item.audioUrl || link.embedUrl),
|
||||||
|
}]
|
||||||
})
|
})
|
||||||
|
|
||||||
const studyLane = study => {
|
const studyLane = study => {
|
||||||
|
|||||||
Reference in new issue
Block a user