mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-05-26 00:55:16 -07:00
style: format youtube runtime files
This commit is contained in:
@@ -30,7 +30,10 @@ test('isYoutubePlaybackActive checks both current media and mpv video paths', ()
|
||||
|
||||
test('isSameYoutubeMediaPath matches equivalent youtube urls by video id', () => {
|
||||
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,
|
||||
);
|
||||
assert.equal(
|
||||
|
||||
@@ -78,10 +78,7 @@ export function shouldUseCachedYoutubeParsedCues(input: {
|
||||
cachedMediaPath: string | null | undefined;
|
||||
cachedCueCount: number;
|
||||
}): boolean {
|
||||
return (
|
||||
input.cachedCueCount > 0 &&
|
||||
isSameYoutubeMediaPath(input.videoPath, input.cachedMediaPath)
|
||||
);
|
||||
return input.cachedCueCount > 0 && isSameYoutubeMediaPath(input.videoPath, input.cachedMediaPath);
|
||||
}
|
||||
|
||||
export function isYoutubePlaybackActive(
|
||||
|
||||
@@ -111,7 +111,10 @@ export function createYoutubePrimarySubtitleNotificationRuntime(deps: {
|
||||
delayMs: number,
|
||||
) => YoutubePrimarySubtitleNotificationTimer;
|
||||
clearSchedule: (timer: YoutubePrimarySubtitleNotificationTimer | null) => void;
|
||||
getCurrentSubtitleState?: () => CurrentSubtitleState | null | Promise<CurrentSubtitleState | null>;
|
||||
getCurrentSubtitleState?: () =>
|
||||
| CurrentSubtitleState
|
||||
| null
|
||||
| Promise<CurrentSubtitleState | null>;
|
||||
delayMs?: number;
|
||||
}) {
|
||||
const delayMs = deps.delayMs ?? 5000;
|
||||
@@ -128,9 +131,7 @@ export function createYoutubePrimarySubtitleNotificationRuntime(deps: {
|
||||
pendingTimer = null;
|
||||
};
|
||||
|
||||
const refreshCurrentSubtitleState = async (
|
||||
preferredLanguages: Set<string>,
|
||||
): Promise<boolean> => {
|
||||
const refreshCurrentSubtitleState = async (preferredLanguages: Set<string>): Promise<boolean> => {
|
||||
const getCurrentSubtitleState = deps.getCurrentSubtitleState;
|
||||
if (!getCurrentSubtitleState) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user