mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-07-07 13:08:54 -07:00
feat(notifications): add overlay notifications with position config (#110)
This commit is contained in:
@@ -74,9 +74,13 @@ export function createHandleMpvMediaPathChangeHandler(deps: {
|
||||
flushPlaybackPositionOnMediaPathClear?: (mediaPath: string) => void;
|
||||
refreshDiscordPresence: () => void;
|
||||
}) {
|
||||
let lastCharacterDictionarySyncMediaPath: string | null = null;
|
||||
|
||||
return ({ path }: { path: string | null }): void => {
|
||||
const normalizedPath = typeof path === 'string' ? path : '';
|
||||
if (!normalizedPath) {
|
||||
const trimmedPath = normalizedPath.trim();
|
||||
if (!trimmedPath) {
|
||||
lastCharacterDictionarySyncMediaPath = null;
|
||||
deps.flushPlaybackPositionOnMediaPathClear?.(normalizedPath);
|
||||
}
|
||||
deps.updateCurrentMediaPath(normalizedPath);
|
||||
@@ -92,9 +96,12 @@ export function createHandleMpvMediaPathChangeHandler(deps: {
|
||||
deps.ensureAnilistMediaGuess(mediaKey);
|
||||
}
|
||||
deps.syncImmersionMediaState();
|
||||
if (normalizedPath.trim().length > 0) {
|
||||
if (trimmedPath.length > 0) {
|
||||
deps.markJellyfinRemotePlaybackLoaded?.(normalizedPath);
|
||||
deps.scheduleCharacterDictionarySync?.();
|
||||
if (trimmedPath !== lastCharacterDictionarySyncMediaPath) {
|
||||
lastCharacterDictionarySyncMediaPath = trimmedPath;
|
||||
deps.scheduleCharacterDictionarySync?.();
|
||||
}
|
||||
deps.signalAutoplayReadyIfWarm?.(normalizedPath);
|
||||
}
|
||||
deps.refreshDiscordPresence();
|
||||
|
||||
Reference in New Issue
Block a user