Enhance AniList character dictionary sync and subtitle features (#15)

This commit is contained in:
2026-03-07 18:30:59 -08:00
committed by GitHub
parent 2f07c3407a
commit e18985fb14
696 changed files with 14297 additions and 173564 deletions
+33
View File
@@ -0,0 +1,33 @@
import assert from 'node:assert/strict';
import test from 'node:test';
import { resolveProxyCommandOsdRuntime } from './mpv-proxy-osd';
function createClient() {
return {
connected: true,
requestProperty: async (name: string) => {
if (name === 'sid') return 3;
if (name === 'secondary-sid') return 8;
if (name === 'track-list') {
return [
{ id: 3, type: 'sub', title: 'Japanese', selected: true, external: false },
{ id: 8, type: 'sub', title: 'English Commentary', external: true },
];
}
return null;
},
};
}
test('resolveProxyCommandOsdRuntime formats the active primary subtitle track label', async () => {
const result = await resolveProxyCommandOsdRuntime(['cycle', 'sid'], () => createClient());
assert.equal(result, 'Subtitle track: Internal #3 - Japanese (active)');
});
test('resolveProxyCommandOsdRuntime formats the active secondary subtitle track label', async () => {
const result = await resolveProxyCommandOsdRuntime(
['set_property', 'secondary-sid', 'auto'],
() => createClient(),
);
assert.equal(result, 'Secondary subtitle track: External #8 - English Commentary');
});