From 03c3dd72fe71e2cadea47dde01134028b92138cc Mon Sep 17 00:00:00 2001 From: nmemmert Date: Tue, 20 Oct 2026 09:09:23 -0400 Subject: [PATCH] Highlights: auto-fill episode audio from the feed by season + episode number; v2.46.1 Co-Authored-By: Claude Sonnet 5.5 --- package.json | 2 +- server/feed-release.js | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 18828bb..d0c4bb4 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "siteforge", "private": true, - "version": "2.46.0", + "version": "2.46.1", "type": "module", "scripts": { "dev": "vite", diff --git a/server/feed-release.js b/server/feed-release.js index cc0ef51..592f408 100644 --- a/server/feed-release.js +++ b/server/feed-release.js @@ -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 => {