feat(aniskip): move intro detection from mpv plugin to app runtime (#117)

This commit is contained in:
2026-06-09 23:55:43 -07:00
committed by GitHub
parent d5bfdcae7b
commit 2007e28be8
49 changed files with 900 additions and 1469 deletions
+9
View File
@@ -4,6 +4,7 @@ export type MpvMessage = {
event?: string;
name?: string;
data?: unknown;
args?: unknown;
request_id?: number;
error?: string;
};
@@ -94,6 +95,7 @@ export interface MpvProtocolHandleMessageDeps {
restorePreviousSecondarySubVisibility: () => void;
shouldQuitOnMpvShutdown: () => boolean;
requestAppQuit: () => void;
emitClientMessage?: (payload: { args: string[] }) => void;
}
type SubtitleTrackCandidate = {
@@ -376,6 +378,13 @@ export async function dispatchMpvProtocolMessage(
});
}
}
} else if (msg.event === 'client-message') {
const args = Array.isArray(msg.args)
? msg.args.filter((arg): arg is string => typeof arg === 'string')
: [];
if (args.length > 0) {
deps.emitClientMessage?.({ args });
}
} else if (msg.event === 'shutdown') {
deps.restorePreviousSecondarySubVisibility();
if (deps.shouldQuitOnMpvShutdown()) {