Apply remaining working-tree updates

This commit is contained in:
2026-02-14 00:36:01 -08:00
parent cb9a599b23
commit a1209ca69f
40 changed files with 1001 additions and 607 deletions

View File

@@ -68,6 +68,7 @@ export interface MpvIpcClientDeps {
getPreviousSecondarySubVisibility: () => boolean | null;
setPreviousSecondarySubVisibility: (value: boolean | null) => void;
showMpvOsd: (text: string) => void;
updateCurrentMediaTitle?: (mediaTitle: unknown) => void;
}
export class MpvIpcClient implements MpvClient {
@@ -285,6 +286,8 @@ export class MpvIpcClient implements MpvClient {
this.pauseAtTime = null;
this.send({ command: ["set_property", "pause", true] });
}
} else if (msg.name === "media-title") {
this.deps.updateCurrentMediaTitle?.(msg.data);
} else if (msg.name === "path") {
this.currentVideoPath = (msg.data as string) || "";
this.deps.updateCurrentMediaPath(msg.data);
@@ -653,6 +656,7 @@ export class MpvIpcClient implements MpvClient {
this.send({ command: ["observe_property", 22, "sub-shadow-offset"] });
this.send({ command: ["observe_property", 23, "sub-ass-override"] });
this.send({ command: ["observe_property", 24, "sub-use-margins"] });
this.send({ command: ["observe_property", 25, "media-title"] });
}
private getInitialState(): void {
@@ -668,6 +672,9 @@ export class MpvIpcClient implements MpvClient {
command: ["get_property", "path"],
request_id: MPV_REQUEST_ID_PATH,
});
this.send({
command: ["get_property", "media-title"],
});
this.send({
command: ["get_property", "secondary-sub-text"],
request_id: MPV_REQUEST_ID_SECONDARY_SUBTEXT,