Jellyfin and Subsync Fixes (#13)

This commit is contained in:
2026-03-01 16:13:16 -08:00
committed by GitHub
parent 49434bf0cd
commit 7023a3263f
36 changed files with 2001 additions and 60 deletions

View File

@@ -42,6 +42,30 @@ test('parseArgs ignores missing value after --log-level', () => {
assert.equal(args.start, true);
});
test('parseArgs handles jellyfin item listing controls', () => {
const args = parseArgs([
'--jellyfin-items',
'--jellyfin-recursive=false',
'--jellyfin-include-item-types',
'Series,Movie,Folder',
]);
assert.equal(args.jellyfinItems, true);
assert.equal(args.jellyfinRecursive, false);
assert.equal(args.jellyfinIncludeItemTypes, 'Series,Movie,Folder');
});
test('parseArgs handles space-separated jellyfin recursive control', () => {
const args = parseArgs(['--jellyfin-items', '--jellyfin-recursive', 'false']);
assert.equal(args.jellyfinRecursive, false);
});
test('parseArgs ignores unrecognized space-separated jellyfin recursive values', () => {
const args = parseArgs(['--jellyfin-items', '--jellyfin-recursive', '--start']);
assert.equal(args.jellyfinRecursive, undefined);
assert.equal(args.start, true);
});
test('hasExplicitCommand and shouldStartApp preserve command intent', () => {
const stopOnly = parseArgs(['--stop']);
assert.equal(hasExplicitCommand(stopOnly), true);
@@ -118,6 +142,19 @@ test('hasExplicitCommand and shouldStartApp preserve command intent', () => {
assert.equal(hasExplicitCommand(jellyfinRemoteAnnounce), true);
assert.equal(shouldStartApp(jellyfinRemoteAnnounce), false);
const jellyfinPreviewAuth = parseArgs([
'--jellyfin-preview-auth',
'--jellyfin-response-path',
'/tmp/subminer-jf-response.json',
]);
assert.equal(jellyfinPreviewAuth.jellyfinPreviewAuth, true);
assert.equal(
jellyfinPreviewAuth.jellyfinResponsePath,
'/tmp/subminer-jf-response.json',
);
assert.equal(hasExplicitCommand(jellyfinPreviewAuth), true);
assert.equal(shouldStartApp(jellyfinPreviewAuth), false);
const background = parseArgs(['--background']);
assert.equal(background.background, true);
assert.equal(hasExplicitCommand(background), true);