mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-09-20 05:16:18 -07:00
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:
@@ -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 };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user