Episode scripts: file by season + episode so numbers can repeat per book; search labels for current series; v2.9.6
Publish Container / build (push) Successful in 16m51s
Publish Container / build (push) Successful in 16m51s
- Scripts keyed "<season>-<episode>" (legacy ones migrate on first start; unseasoned ones keep their plain key) - Season backfill handles episode numbers shared across seasons (title match fallback) - Fix: "Backfill seasons from RSS" was swallowed by the upload route - Global search labels script results with the title of the series playing now (both lanes), not just finished books Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4ddedf0f81
commit
752611d121
7 files changed
+114
-41
No files matched your search
@@ -25,6 +25,7 @@ interface PublicQuestion {
|
||||
}
|
||||
|
||||
interface ScriptSearchResult {
|
||||
key?: string
|
||||
episodeNumber: string
|
||||
title: string
|
||||
filename: string
|
||||
@@ -121,8 +122,11 @@ export function useGlobalSearch(content: SiteContent) {
|
||||
for (const book of content.finishedBooks ?? []) {
|
||||
if (book.season != null && book.title) map.set(String(book.season), book.title)
|
||||
}
|
||||
// The series playing now (one or two at a time), so their scripts show a title too
|
||||
if (content.seriesSeason != null && content.seriesTitle) map.set(String(content.seriesSeason), content.seriesTitle)
|
||||
if (content.secondSeries?.season != null && content.secondSeries.title) map.set(String(content.secondSeries.season), content.secondSeries.title)
|
||||
return map
|
||||
}, [content.finishedBooks])
|
||||
}, [content.finishedBooks, content.seriesSeason, content.seriesTitle, content.secondSeries])
|
||||
|
||||
// Debounced server-side script search — runs whenever query changes
|
||||
useEffect(() => {
|
||||
@@ -138,7 +142,7 @@ export function useGlobalSearch(content: SiteContent) {
|
||||
const results = (data.results ?? []).map(r => {
|
||||
const seasonLabel = r.season ? (seasonTitleMap.get(r.season) ?? `Season ${r.season}`) : null
|
||||
return {
|
||||
id: `script-${r.episodeNumber}`,
|
||||
id: `script-${r.key ?? r.episodeNumber}`,
|
||||
type: 'episode' as const,
|
||||
title: r.title,
|
||||
subtitle: [`Episode ${r.episodeNumber}`, seasonLabel, 'Script'].filter(Boolean).join(' · '),
|
||||
|
||||
Reference in new issue
Block a user