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
+19
View File
@@ -1,5 +1,6 @@
import type {
AnimeBrowserBridgeInstall,
AnimeBrowserBridgeState,
AnimeBrowserSearchResult,
AnimeBrowserSource,
InstalledExtensionView,
@@ -47,3 +48,21 @@ export function describeBridgeInstall(install: AnimeBrowserBridgeInstall | null)
}
return `M-Extension-Server ${version} in ${install.dir}, downloaded by SubMiner. SubMiner checks this installation for updates after startup.`;
}
/** Update notices are informational for bridges installed outside SubMiner. */
export function describeBridgeUpdate(state: AnimeBrowserBridgeState): {
message: string;
buttonLabel: string | null;
} | null {
const install = state.install;
if (state.stage !== 'ready' || !install || install.updateAvailable === null) return null;
const message = `Extension bridge ${install.version ?? 'of unknown version'} is installed; ${install.updateAvailable} is available.`;
if (install.origin === 'managed') {
return { message, buttonLabel: `Update to ${install.updateAvailable}` };
}
const instruction =
install.dir.replace(/\/+$/, '') === '/usr/share/mangatan/extension_server'
? 'Update mangatan-extension-server through your AUR helper (for example: paru -S mangatan-extension-server), then restart SubMiner.'
: 'Update your bridge through your package manager or its original installation method, then restart SubMiner.';
return { message: `${message} ${instruction}`, buttonLabel: null };
}