feat(anime): filter episodes and mark them watched by hand

- Add a filter box above the episode list for a number, range, or name substring, with a "N of M" counter
- Read watch marks from the immersion tracker stats and show them per episode, with a watched count in the header, refreshed on window focus
- Add a right-click menu to mark one episode or a whole catch-up span (this and everything below) watched/unwatched
- Add setWatched/getWatchState IPC plumbing so a manual mark creates the stats row for an episode that was never played
This commit is contained in:
2026-08-15 21:44:51 -07:00
parent 3dd0750b98
commit 8d55d64ee0
23 changed files with 1601 additions and 111 deletions
+10
View File
@@ -3332,6 +3332,16 @@ const animeBrowserRuntime = createAnimeBrowserRuntime({
},
showMpvOsd: (text) =>
overlayNotificationsRuntime.showConfiguredStatusNotification(text, { title: 'Anime' }),
getWatchState: async (statsPaths) => {
// Browsing can precede any playback, so the tracker may not be up yet; it
// is the same instance playback records into once it is.
ensureImmersionTrackerStarted();
return (await appState.immersionTracker?.getStreamWatchState(statsPaths)) ?? new Map();
},
setWatchState: async (episodes, watched) => {
ensureImmersionTrackerStarted();
return (await appState.immersionTracker?.setStreamWatchState(episodes, watched)) ?? 0;
},
onPlaybackMetadata: (metadata) => {
streamPlaybackMetadata.set(metadata);
// Set before mpv reports the path change, so the session that change starts