mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-03-21 00:11:27 -07:00
feat: wire up subtitle prefetch service to MPV events
Initializes prefetch on external subtitle track activation, detects seeks via time-pos delta threshold, pauses prefetch during live subtitle processing, and restarts on cache invalidation. - Extract loadSubtitleSourceText into reusable function - Add prefetch service state and initSubtitlePrefetch helper - Thread onTimePosUpdate through event actions/bindings/main-deps - Pause prefetch on subtitle change, resume on emit - Restart prefetch after tokenization cache invalidation - Query track-list on media path change to find external subs
This commit is contained in:
@@ -90,11 +90,13 @@ export function createHandleMpvTimePosChangeHandler(deps: {
|
||||
recordPlaybackPosition: (time: number) => void;
|
||||
reportJellyfinRemoteProgress: (forceImmediate: boolean) => void;
|
||||
refreshDiscordPresence: () => void;
|
||||
onTimePosUpdate?: (time: number) => void;
|
||||
}) {
|
||||
return ({ time }: { time: number }): void => {
|
||||
deps.recordPlaybackPosition(time);
|
||||
deps.reportJellyfinRemoteProgress(false);
|
||||
deps.refreshDiscordPresence();
|
||||
deps.onTimePosUpdate?.(time);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user