mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-04-10 16:19:24 -07:00
Jellyfin and Subsync Fixes (#13)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user