Restore multi-copy digit capture and add AniList selection (#56)

This commit is contained in:
2026-04-25 21:44:55 -07:00
committed by GitHub
parent 7ac51cd5e9
commit d8934647a9
140 changed files with 4097 additions and 326 deletions
@@ -0,0 +1,27 @@
import assert from 'node:assert/strict';
import test from 'node:test';
import { applyCharacterDictionarySelection } from './character-dictionary-selection';
test('applyCharacterDictionarySelection returns saved override when post-save sync fails', async () => {
const warnings: unknown[] = [];
const result = await applyCharacterDictionarySelection(
{ mediaId: 21355 },
{
setManualSelection: async (request) => ({
ok: true,
seriesKey: `series-${request.mediaId}`,
selected: { id: request.mediaId, title: 'Re:ZERO', episodes: 25 },
staleMediaIds: [10607],
}),
resetAnilistMediaGuessState: () => {},
runSyncNow: async () => {
throw new Error('sync failed');
},
warn: (...args) => warnings.push(args),
},
);
assert.equal(result.selected.id, 21355);
assert.equal(warnings.length, 1);
});