fix: pace AniList character dictionary requests

This commit is contained in:
2026-03-05 23:57:38 -08:00
parent 72b18110b5
commit ac4fd60098
7 changed files with 269 additions and 32 deletions

View File

@@ -115,3 +115,16 @@ test('dictionary command forwards --dictionary and target path to app binary', (
assert.deepEqual(forwarded, [['--dictionary', '--dictionary-target', '/tmp/anime']]);
});
test('dictionary command throws if app handoff unexpectedly returns', () => {
const context = createContext();
context.args.dictionary = true;
assert.throws(
() =>
runDictionaryCommand(context, {
runAppCommandWithInherit: () => undefined as never,
}),
/unexpectedly returned/,
);
});

View File

@@ -27,5 +27,5 @@ export function runDictionaryCommand(
}
deps.runAppCommandWithInherit(appPath, forwarded);
return true;
throw new Error('Dictionary command app handoff unexpectedly returned.');
}

View File

@@ -1,18 +1,6 @@
import path from 'node:path';
import os from 'node:os';
export const VIDEO_EXTENSIONS = new Set([
'mkv',
'mp4',
'avi',
'webm',
'mov',
'flv',
'wmv',
'm4v',
'ts',
'm2ts',
]);
export { VIDEO_EXTENSIONS } from '../src/shared/video-extensions.js';
export const ROFI_THEME_FILE = 'subminer.rasi';
export const DEFAULT_SOCKET_PATH = '/tmp/subminer-socket';