[codex] Fix Jellyfin setup and discovery toggle (#59)

This commit is contained in:
2026-05-02 19:56:10 -07:00
committed by GitHub
parent 27f5b2bb58
commit db30c61327
38 changed files with 1372 additions and 107 deletions
@@ -78,6 +78,37 @@ test('start handler no-ops when remote control is disabled', async () => {
assert.equal(created, false);
});
test('start handler respects auto-connect unless explicit start is requested', async () => {
let created = 0;
const startRemote = createStartJellyfinRemoteSessionHandler({
getJellyfinConfig: () => createConfig({ remoteControlAutoConnect: false }),
getCurrentSession: () => null,
setCurrentSession: () => {},
createRemoteSessionService: () => {
created += 1;
return {
start: () => {},
stop: () => {},
advertiseNow: async () => true,
};
},
defaultDeviceId: 'default-device',
defaultClientName: 'SubMiner',
defaultClientVersion: '1.0',
handlePlay: async () => {},
handlePlaystate: async () => {},
handleGeneralCommand: async () => {},
logInfo: () => {},
logWarn: () => {},
});
await startRemote();
assert.equal(created, 0);
await startRemote({ explicit: true });
assert.equal(created, 1);
});
test('start handler creates, starts, and stores session', async () => {
let storedSession: {
start: () => void;