feat(launcher): add -H/--history command to browse local watch history

- New `subminer -H` flag opens an fzf/rofi menu of watched series from the immersion tracker DB
- Actions: replay last episode, play next episode (cross-season), or browse episodes
- Adds `history.ts` with DB query, series grouping, season dir listing, and next-episode logic
- Adds `bun-sqlite.d.ts` ambient types for tsc compat
- Includes full test coverage in `history.test.ts`
This commit is contained in:
2026-07-05 00:29:52 -07:00
parent 73af1451b7
commit 29e2a266e2
15 changed files with 777 additions and 1 deletions
+11
View File
@@ -21,6 +21,7 @@ import { runDictionaryCommand } from './commands/dictionary-command.js';
import { runLogsCommand } from './commands/logs-command.js';
import { runStatsCommand } from './commands/stats-command.js';
import { runJellyfinCommand } from './commands/jellyfin-command.js';
import { runHistoryCommand } from './commands/history-command.js';
import { runPlaybackCommand } from './commands/playback-command.js';
import { runUpdateCommand } from './commands/update-command.js';
@@ -142,6 +143,16 @@ async function main(): Promise<void> {
return;
}
if (appContext.args.history) {
const selected = await runHistoryCommand(appContext);
if (!selected) {
log('info', args.logLevel, 'No watch history selection made, exiting');
return;
}
appContext.args.target = selected;
appContext.args.targetKind = 'file';
}
await runPlaybackCommand(appContext);
}