style: format youtube runtime files

This commit is contained in:
2026-05-24 19:10:58 -07:00
parent d6ff50455a
commit e9abbd5f05
3 changed files with 10 additions and 9 deletions
+4 -1
View File
@@ -30,7 +30,10 @@ test('isYoutubePlaybackActive checks both current media and mpv video paths', ()
test('isSameYoutubeMediaPath matches equivalent youtube urls by video id', () => { test('isSameYoutubeMediaPath matches equivalent youtube urls by video id', () => {
assert.equal( assert.equal(
isSameYoutubeMediaPath('https://www.youtube.com/watch?v=abc123&t=30', 'https://youtu.be/abc123'), isSameYoutubeMediaPath(
'https://www.youtube.com/watch?v=abc123&t=30',
'https://youtu.be/abc123',
),
true, true,
); );
assert.equal( assert.equal(
+1 -4
View File
@@ -78,10 +78,7 @@ export function shouldUseCachedYoutubeParsedCues(input: {
cachedMediaPath: string | null | undefined; cachedMediaPath: string | null | undefined;
cachedCueCount: number; cachedCueCount: number;
}): boolean { }): boolean {
return ( return input.cachedCueCount > 0 && isSameYoutubeMediaPath(input.videoPath, input.cachedMediaPath);
input.cachedCueCount > 0 &&
isSameYoutubeMediaPath(input.videoPath, input.cachedMediaPath)
);
} }
export function isYoutubePlaybackActive( export function isYoutubePlaybackActive(
@@ -111,7 +111,10 @@ export function createYoutubePrimarySubtitleNotificationRuntime(deps: {
delayMs: number, delayMs: number,
) => YoutubePrimarySubtitleNotificationTimer; ) => YoutubePrimarySubtitleNotificationTimer;
clearSchedule: (timer: YoutubePrimarySubtitleNotificationTimer | null) => void; clearSchedule: (timer: YoutubePrimarySubtitleNotificationTimer | null) => void;
getCurrentSubtitleState?: () => CurrentSubtitleState | null | Promise<CurrentSubtitleState | null>; getCurrentSubtitleState?: () =>
| CurrentSubtitleState
| null
| Promise<CurrentSubtitleState | null>;
delayMs?: number; delayMs?: number;
}) { }) {
const delayMs = deps.delayMs ?? 5000; const delayMs = deps.delayMs ?? 5000;
@@ -128,9 +131,7 @@ export function createYoutubePrimarySubtitleNotificationRuntime(deps: {
pendingTimer = null; pendingTimer = null;
}; };
const refreshCurrentSubtitleState = async ( const refreshCurrentSubtitleState = async (preferredLanguages: Set<string>): Promise<boolean> => {
preferredLanguages: Set<string>,
): Promise<boolean> => {
const getCurrentSubtitleState = deps.getCurrentSubtitleState; const getCurrentSubtitleState = deps.getCurrentSubtitleState;
if (!getCurrentSubtitleState) { if (!getCurrentSubtitleState) {
return false; return false;