feat(anime): support shared bridge installs and updates

- Prefer configured or package-managed bridge bundles before downloading
- Select compatible upstream releases and offer managed-bundle updates
- Document bridge configuration and package dependencies
This commit is contained in:
2026-09-01 23:14:16 -07:00
parent 1d1575f414
commit 2bcb6c7e98
33 changed files with 1136 additions and 229 deletions
+28 -1
View File
@@ -128,17 +128,38 @@ export type AnimeBrowserBridgeStage =
| 'idle'
| 'locating'
| 'downloading'
| 'verifying'
| 'extracting'
| 'starting'
| 'ready'
| 'failed';
/** Where the running bridge came from, and whether SubMiner can move it forward. */
export interface AnimeBrowserBridgeInstall {
/**
* `managed`: downloaded by SubMiner into its own directory, so it can be
* updated from the browser. `system`: a package-manager install (the AUR
* `mangatan-extension-server` package) or an `anime.bridgeDir` the user
* pointed at; SubMiner uses it as found and never writes to it.
*/
origin: 'managed' | 'system';
/** Release tag, e.g. `v1.0.6.2`, or null when it cannot be read. */
version: string | null;
dir: string;
/**
* The newest upstream release with a bundle for this platform, when it is
* newer than a managed install; null when current, not managed, or not yet
* checked. Filled in once the bridge is running, since it needs the network.
*/
updateAvailable: string | null;
}
export interface AnimeBrowserBridgeState {
stage: AnimeBrowserBridgeStage;
/** 0-1 while downloading, otherwise null. */
progress: number | null;
message: string | null;
/** Null until the bridge binaries have been located. */
install: AnimeBrowserBridgeInstall | null;
}
/** An extension APK that failed to load, surfaced instead of silently vanishing. */
@@ -255,6 +276,12 @@ export interface AnimeBrowserQueueState {
export interface AnimeBrowserAPI {
getSnapshot: () => Promise<AnimeBrowserSnapshot>;
ensureBridge: () => Promise<AnimeBrowserBridgeState>;
/**
* Download the newest release over a managed install and restart the bridge
* on it. Rejected for a system install. A playing episode's stream dies with
* the old bridge.
*/
updateBridge: () => Promise<AnimeBrowserBridgeState>;
selectSource: (sourceId: string) => Promise<void>;
search: (query: string, page?: number) => Promise<AnimeBrowserSearchResult>;
getPopular: (page?: number) => Promise<AnimeBrowserSearchResult>;
+6
View File
@@ -58,6 +58,12 @@ export interface AnimeConfig {
repos?: string[];
/** Preferred stream label, matched as a substring, e.g. "1080". */
preferredQuality?: string;
/**
* Directory holding an M-Extension-Server bundle (java runtime plus server
* jar) to run instead of the copy SubMiner downloads. Empty checks the
* package-manager location, then the managed copy.
*/
bridgeDir?: string;
}
export interface JimakuConfig {