fix(jellyfin): keep selecting subtitles when a track download fails (#272)

This commit is contained in:
sudacode authored and GitHub committed 2026-09-24 21:32:56 -07:00
1 parent 63eb228e4f
commit b24008237b
5 files changed
+91 -18

No files matched your search

+11 -2
View File
@@ -377,6 +377,14 @@ test('listSubtitleTracks returns all subtitle streams with delivery urls', async
DeliveryUrl: 'https://cdn.example.com/subs.srt',
IsExternalUrl: true,
},
{
Type: 'Subtitle',
Index: 5,
Codec: 'PGSSUB',
Language: 'eng',
DisplayTitle: 'English PGS',
DeliveryMethod: 'Embed',
},
],
},
],
@@ -395,10 +403,10 @@ test('listSubtitleTracks returns all subtitle streams with delivery urls', async
clientInfo,
'movie-1',
);
assert.equal(tracks.length, 3);
assert.equal(tracks.length, 4);
assert.deepEqual(
tracks.map((track) => track.index),
[2, 3, 4],
[2, 3, 4, 5],
);
assert.equal(
tracks[0]!.deliveryUrl,
@@ -409,6 +417,7 @@ test('listSubtitleTracks returns all subtitle streams with delivery urls', async
'http://jellyfin.local/Videos/movie-1/ms-1/Subtitles/3/Stream.srt?ApiKey=token',
);
assert.equal(tracks[2]!.deliveryUrl, 'https://cdn.example.com/subs.srt');
assert.equal(tracks[3]!.deliveryUrl, null, 'bitmap subtitles cannot be fetched as text');
} finally {
globalThis.fetch = originalFetch;
}