mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-11-23 16:46:07 -08:00
feat(notifications): add overlay notifications with position config (#110)
This commit is contained in:
1 parent
c09d009a3e
commit
7be1843c41
177 files changed
+7524
-440
No files matched your search
@@ -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