feat(anime): remember the default Anime Browser source

- Add `anime.defaultSource` with installed-source fallback
- Let the source picker save a source or All sources as default
This commit is contained in:
2026-09-02 23:17:20 -07:00
parent 516fadd530
commit 68dd789fbf
22 changed files with 260 additions and 19 deletions
+4
View File
@@ -218,6 +218,8 @@ export interface AnimeBrowserSnapshot {
bridge: AnimeBrowserBridgeState;
sources: AnimeBrowserSource[];
selectedSourceId: string | null;
/** Configured `anime.defaultSource`, verbatim; null when unset. */
defaultSourceId: string | null;
loadFailures: ExtensionLoadFailure[];
/** Every extension on disk, whether or not it loaded. */
installed: InstalledExtensionView[];
@@ -287,6 +289,8 @@ export interface AnimeBrowserAPI {
*/
updateBridge: () => Promise<AnimeBrowserBridgeState>;
selectSource: (sourceId: string) => Promise<void>;
/** Persist the source (or `all`) new browser sessions open on. */
setDefaultSource: (sourceId: string) => Promise<void>;
search: (query: string, page?: number) => Promise<AnimeBrowserSearchResult>;
getPopular: (page?: number) => Promise<AnimeBrowserSearchResult>;
/** `sourceId` is required after an all-sources search; pass the entry's own. */
+1
View File
@@ -325,6 +325,7 @@ export interface ResolvedConfig {
extensionsDir: string;
repos: string[];
preferredQuality: string;
defaultSource: string;
bridgeDir: string;
};
jimaku: JimakuConfig & {
+5
View File
@@ -63,6 +63,11 @@ export interface AnimeConfig {
repos?: string[];
/** Preferred stream label, matched as a substring, e.g. "1080". */
preferredQuality?: string;
/**
* Source id (`<package>:<source>`) selected when the browser opens, or
* "all" for every installed source. Empty selects the first installed one.
*/
defaultSource?: string;
/**
* Directory holding an M-Extension-Server bundle (java runtime plus server
* jar) to run instead of the copy SubMiner downloads. Empty checks the