fix(anime): clarify bridge failures and update guidance

- Show actionable bridge errors and preserve episodes when details fail
- Check external bridges for updates without offering unsafe in-app installs
- Complete cleanup and ignore callbacks from closed Tsukihime sessions
This commit is contained in:
2026-09-16 23:25:21 -07:00
parent 93fb4eff3a
commit ca40cd6267
23 changed files with 653 additions and 149 deletions
+22 -12
View File
@@ -37,6 +37,7 @@ export function createOnWillQuitCleanupHandler(deps: {
stopDiscordPresenceService: () => void;
}) {
return async (): Promise<void> => {
const cleanupErrors: unknown[] = [];
deps.destroyTray();
deps.stopConfigHotReload();
deps.restorePreviousSecondarySubVisibility();
@@ -44,7 +45,11 @@ export function createOnWillQuitCleanupHandler(deps: {
deps.unregisterAllGlobalShortcuts();
deps.stopSubtitleWebsocket();
deps.stopTexthookerService();
const stopSyncAutoScheduler = deps.stopSyncAutoScheduler();
const stopSyncAutoScheduler = Promise.resolve(deps.stopSyncAutoScheduler()).catch(
(error: unknown) => {
cleanupErrors.push(error);
},
);
deps.clearWindowsVisibleOverlayForegroundPollLoop();
deps.clearLinuxMpvFullscreenOverlayRefreshTimeouts();
deps.destroyMainOverlayWindow();
@@ -66,20 +71,25 @@ export function createOnWillQuitCleanupHandler(deps: {
deps.clearFirstRunSetupWindow();
deps.destroyYomitanSettingsWindow();
deps.clearYomitanSettingsWindow();
try {
deps.stopJellyfinRemoteSession();
} finally {
const runCleanup = (cleanup: () => void): void => {
try {
deps.cleanupJellyfinSubtitleCache();
} finally {
deps.cleanupInternalSubtitleTrackCache();
cleanup();
} catch (error) {
cleanupErrors.push(error);
}
};
try {
runCleanup(deps.stopJellyfinRemoteSession);
runCleanup(deps.cleanupJellyfinSubtitleCache);
runCleanup(deps.cleanupInternalSubtitleTrackCache);
} finally {
runCleanup(deps.cleanupYoutubeSubtitleTempDirs);
runCleanup(deps.cleanupYoutubeMediaCache);
runCleanup(deps.cleanupRemoteMediaWindows);
runCleanup(deps.stopDiscordPresenceService);
await stopSyncAutoScheduler;
}
deps.cleanupYoutubeSubtitleTempDirs();
deps.cleanupYoutubeMediaCache();
deps.cleanupRemoteMediaWindows();
deps.stopDiscordPresenceService();
await stopSyncAutoScheduler;
if (cleanupErrors.length > 0) throw cleanupErrors[0];
};
}