fix(immersion): special-case youtube media paths in runtime and tracking

This commit is contained in:
2026-03-23 00:36:19 -07:00
parent 3e7615b3bd
commit 2e43d95396
20 changed files with 1481 additions and 56 deletions

View File

@@ -1,11 +1,15 @@
import type { AnilistMediaGuessRuntimeState } from './anilist-media-guess';
import { isYoutubeMediaPath } from './youtube-playback';
export function createGetCurrentAnilistMediaKeyHandler(deps: {
getCurrentMediaPath: () => string | null;
}) {
return (): string | null => {
const mediaPath = deps.getCurrentMediaPath()?.trim();
return mediaPath && mediaPath.length > 0 ? mediaPath : null;
if (!mediaPath || mediaPath.length === 0 || isYoutubeMediaPath(mediaPath)) {
return null;
}
return mediaPath;
};
}