From ca931406a4b846ddd18bad6374c28b9fc06dbf7d Mon Sep 17 00:00:00 2001 From: mkelvers Date: Fri, 1 May 2026 17:47:17 +0200 Subject: [PATCH] fix(player): restore accidentally deleted currentMode initialization --- static/player.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/static/player.ts b/static/player.ts index 0a1a8af..57b4a25 100644 --- a/static/player.ts +++ b/static/player.ts @@ -138,6 +138,13 @@ const initPlayer = (): void => { let preloadAttemptedForEpisode: number | null = null let activeSkipSegment: { type: string, start: number, end: number } | null = null let activeSubtitles: Array<{ start: number, end: number, text: string }> = [] + let currentSubtitleTracks: Array<{ lang: string, label: string, url: string }> = [] + + let currentMode = availableModes.includes(initialMode) ? initialMode : (availableModes[0] || 'dub') + const fallbackMode = Object.keys(modeSources).find((mode) => typeof modeSources[mode]?.token === 'string' && modeSources[mode].token !== '') + if ((!modeSources[currentMode] || !modeSources[currentMode].token) && fallbackMode) { + currentMode = fallbackMode + } const watchProgressURL = '/api/watch-progress' const previewPopover = container.querySelector('[data-preview-popover]') as HTMLElement