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
+32 -1
View File
@@ -1,6 +1,11 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import { describeInstalled, sourceOptionLabel, summarizeSearch } from './format';
import {
describeInstalled,
sourceOptionLabel,
summarizeSearch,
describeBridgeInstall,
} from './format';
import type { AnimeBrowserSearchResult } from '../types/anime-browser';
const result = (
@@ -58,3 +63,29 @@ test('describeInstalled falls back to the package alone when nothing loaded', ()
'broken',
);
});
test('describeBridgeInstall says who updates the bridge', () => {
assert.match(describeBridgeInstall(null), /not started/);
assert.match(
describeBridgeInstall({
origin: 'system',
version: 'v1.0.6.2',
dir: '/usr/share/mangatan/extension_server',
updateAvailable: null,
}),
/v1\.0\.6\.2 from \/usr\/share\/mangatan\/extension_server.*package manager/,
);
assert.match(
describeBridgeInstall({
origin: 'managed',
version: 'v1.0.5.0',
dir: '/home/u/.config/SubMiner/anime-bridge',
updateAvailable: 'v1.0.6.0',
}),
/v1\.0\.6\.0 is available/,
);
assert.match(
describeBridgeInstall({ origin: 'managed', version: null, dir: '/d', updateAvailable: null }),
/unknown version.*up to date/,
);
});