refactor(launcher): split history.ts into focused modules

- Extract types → history-types.ts, DB layer → history-db.ts, navigation → history-navigation.ts
- history.ts becomes a re-export barrel
- Fix findNextEpisode: deleted-file fallback now advances to next season
- Add isReadonlyWalRetryError (WAL-mode guard before read-write retry)
- Strengthen bun-sqlite.d.ts with generics on Statement/query/prepare
This commit is contained in:
2026-07-05 00:57:06 -07:00
parent f4c98278c1
commit 651e541ea8
6 changed files with 324 additions and 239 deletions
+21
View File
@@ -0,0 +1,21 @@
export interface HistoryVideoRow {
videoId: number;
sourcePath: string;
parsedTitle: string | null;
parsedSeason: number | null;
parsedEpisode: number | null;
animeTitle: string | null;
lastWatchedMs: number;
}
export interface HistorySeriesEntry {
seriesRoot: string;
displayName: string;
lastWatched: HistoryVideoRow;
}
export interface SeasonDirEntry {
name: string;
path: string;
season: number | null;
}