Enhance AniList character dictionary sync and subtitle features (#15)

This commit is contained in:
2026-03-07 18:30:59 -08:00
committed by GitHub
parent 2f07c3407a
commit e18985fb14
696 changed files with 14297 additions and 173564 deletions

View File

@@ -53,7 +53,10 @@ export function showMpvOsdRuntime(
fallbackLog: (text: string) => void = (line) => logger.info(line),
): void {
if (mpvClient && mpvClient.connected) {
mpvClient.send({ command: ['show-text', text, '3000'] });
const command = text.includes('${')
? ['expand-properties', 'show-text', text, '3000']
: ['show-text', text, '3000'];
mpvClient.send({ command });
return;
}
fallbackLog(`OSD (MPV not connected): ${text}`);
@@ -161,6 +164,7 @@ export class MpvIpcClient implements MpvClient {
osdDimensions: null,
};
private previousSecondarySubVisibility: boolean | null = null;
private playbackPaused: boolean | null = null;
private pauseAtTime: number | null = null;
private pendingPauseAtSubEnd = false;
private nextDynamicRequestId = 1000;
@@ -207,6 +211,7 @@ export class MpvIpcClient implements MpvClient {
this.connected = false;
this.connecting = false;
this.socket = null;
this.playbackPaused = null;
this.emit('connection-change', { connected: false });
this.failPendingRequests();
this.scheduleReconnect();
@@ -310,6 +315,7 @@ export class MpvIpcClient implements MpvClient {
this.emit('time-pos-change', payload);
},
emitPauseChange: (payload) => {
this.playbackPaused = payload.paused;
this.emit('pause-change', payload);
},
emitSecondarySubtitleChange: (payload) => {
@@ -492,6 +498,12 @@ export class MpvIpcClient implements MpvClient {
}
playNextSubtitle(): void {
if (this.playbackPaused === true) {
this.pendingPauseAtSubEnd = false;
this.pauseAtTime = null;
this.send({ command: ['sub-seek', 1] });
return;
}
this.pendingPauseAtSubEnd = true;
this.send({ command: ['sub-seek', 1] });
}