Highlights: auto-fill episode audio from the feed by season + episode number; v2.46.1
Publish Container / build (push) Successful in 15m38s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
nmemmertandClaude Sonnet 5.5 committed 2026-10-20 09:09:23 -04:00
1 parent 30a7e8a6cb
commit 03c3dd72fe
2 files changed
+12 -7

No files matched your search

+11 -6
View File
@@ -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
// 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
// - 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
@@ -44,7 +44,7 @@ export async function applyFeedRelease(content) {
const links = Array.isArray(content.podcastFeaturedLinks) ? content.podcastFeaturedLinks : []
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 seasonA = laneSeasonOf('A', wf, content)
@@ -52,11 +52,16 @@ export async function applyFeedRelease(content) {
const nextLinks = links.flatMap(link => {
// 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 item = season && link.episodeNumber ? index.get(`${season}-${link.episodeNumber}`) : null
if (!item) return []
return [{ ...link, url: link.url || item.link || '' }]
const item = season && link.episodeNumber ? index.get(`${season}-${String(link.episodeNumber).trim()}`) : null
if (!item) return link.holdUntilReleased ? [] : [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 => {