fix(ci): restore jellyfin preview auth typing parity

This commit is contained in:
2026-03-01 15:34:47 -08:00
parent 1914c550a5
commit 18a555eb95
6 changed files with 31 additions and 0 deletions

View File

@@ -39,6 +39,7 @@ function makeArgs(overrides: Partial<CliArgs> = {}): CliArgs {
jellyfinSubtitleUrlsOnly: false, jellyfinSubtitleUrlsOnly: false,
jellyfinPlay: false, jellyfinPlay: false,
jellyfinRemoteAnnounce: false, jellyfinRemoteAnnounce: false,
jellyfinPreviewAuth: false,
texthooker: false, texthooker: false,
help: false, help: false,
autoStartOverlay: false, autoStartOverlay: false,

View File

@@ -39,6 +39,7 @@ function makeArgs(overrides: Partial<CliArgs> = {}): CliArgs {
jellyfinSubtitleUrlsOnly: false, jellyfinSubtitleUrlsOnly: false,
jellyfinPlay: false, jellyfinPlay: false,
jellyfinRemoteAnnounce: false, jellyfinRemoteAnnounce: false,
jellyfinPreviewAuth: false,
texthooker: false, texthooker: false,
help: false, help: false,
autoStartOverlay: false, autoStartOverlay: false,

View File

@@ -1498,6 +1498,10 @@ const {
listJellyfinItemsRuntime(session, clientInfo, params), listJellyfinItemsRuntime(session, clientInfo, params),
listJellyfinSubtitleTracks: (session, clientInfo, itemId) => listJellyfinSubtitleTracks: (session, clientInfo, itemId) =>
listJellyfinSubtitleTracksRuntime(session, clientInfo, itemId), listJellyfinSubtitleTracksRuntime(session, clientInfo, itemId),
writeJellyfinPreviewAuth: (responsePath, payload) => {
fs.mkdirSync(path.dirname(responsePath), { recursive: true });
fs.writeFileSync(responsePath, JSON.stringify(payload, null, 2), 'utf-8');
},
logInfo: (message) => logger.info(message), logInfo: (message) => logger.info(message),
}, },
handleJellyfinPlayCommandMainDeps: { handleJellyfinPlayCommandMainDeps: {

View File

@@ -111,6 +111,7 @@ test('composeJellyfinRuntimeHandlers returns callable jellyfin runtime handlers'
listJellyfinLibraries: async () => [], listJellyfinLibraries: async () => [],
listJellyfinItems: async () => [], listJellyfinItems: async () => [],
listJellyfinSubtitleTracks: async () => [], listJellyfinSubtitleTracks: async () => [],
writeJellyfinPreviewAuth: () => {},
logInfo: () => {}, logInfo: () => {},
}, },
handleJellyfinPlayCommandMainDeps: { handleJellyfinPlayCommandMainDeps: {

View File

@@ -31,6 +31,10 @@ test('jellyfin auth commands main deps builder maps callbacks', async () => {
test('jellyfin list commands main deps builder maps callbacks', async () => { test('jellyfin list commands main deps builder maps callbacks', async () => {
const calls: string[] = []; const calls: string[] = [];
const writes: Array<{
responsePath: string;
payload: { serverUrl: string; accessToken: string; userId: string };
}> = [];
const deps = createBuildHandleJellyfinListCommandsMainDepsHandler({ const deps = createBuildHandleJellyfinListCommandsMainDepsHandler({
listJellyfinLibraries: async () => { listJellyfinLibraries: async () => {
calls.push('libraries'); calls.push('libraries');
@@ -44,14 +48,32 @@ test('jellyfin list commands main deps builder maps callbacks', async () => {
calls.push('subtitles'); calls.push('subtitles');
return []; return [];
}, },
writeJellyfinPreviewAuth: (responsePath, payload) => {
writes.push({ responsePath, payload });
},
logInfo: (message) => calls.push(`info:${message}`), logInfo: (message) => calls.push(`info:${message}`),
})(); })();
await deps.listJellyfinLibraries({} as never, {} as never); await deps.listJellyfinLibraries({} as never, {} as never);
await deps.listJellyfinItems({} as never, {} as never, { libraryId: '', limit: 1 }); await deps.listJellyfinItems({} as never, {} as never, { libraryId: '', limit: 1 });
await deps.listJellyfinSubtitleTracks({} as never, {} as never, 'id'); await deps.listJellyfinSubtitleTracks({} as never, {} as never, 'id');
deps.writeJellyfinPreviewAuth('/tmp/jellyfin-preview.json', {
serverUrl: 'https://example.test',
accessToken: 'token',
userId: 'user-id',
});
deps.logInfo('done'); deps.logInfo('done');
assert.deepEqual(calls, ['libraries', 'items', 'subtitles', 'info:done']); assert.deepEqual(calls, ['libraries', 'items', 'subtitles', 'info:done']);
assert.deepEqual(writes, [
{
responsePath: '/tmp/jellyfin-preview.json',
payload: {
serverUrl: 'https://example.test',
accessToken: 'token',
userId: 'user-id',
},
},
]);
}); });
test('jellyfin play command main deps builder maps callbacks', async () => { test('jellyfin play command main deps builder maps callbacks', async () => {

View File

@@ -32,6 +32,8 @@ export function createBuildHandleJellyfinListCommandsMainDepsHandler(
deps.listJellyfinItems(session, clientInfo, params), deps.listJellyfinItems(session, clientInfo, params),
listJellyfinSubtitleTracks: (session, clientInfo, itemId) => listJellyfinSubtitleTracks: (session, clientInfo, itemId) =>
deps.listJellyfinSubtitleTracks(session, clientInfo, itemId), deps.listJellyfinSubtitleTracks(session, clientInfo, itemId),
writeJellyfinPreviewAuth: (responsePath, payload) =>
deps.writeJellyfinPreviewAuth(responsePath, payload),
logInfo: (message: string) => deps.logInfo(message), logInfo: (message: string) => deps.logInfo(message),
}); });
} }