test(e2e): check Jellyfin playlist titles only on mpv 0.42+

playlist/N/title is read-only before mpv 0.42, so the CI runners on 0.41
keep listing stream URLs. Note the version requirement in the docs.
This commit is contained in:
sudacode committed 2026-11-23 01:42:30 -08:00
1 parent ec98118006
commit 93d95538ae
2 files changed
+22 -9

No files matched your search

+1 -1
View File
@@ -31,7 +31,7 @@ Casting finds mpv through `mpv.executablePath`, then `SUBMINER_MPV_PATH`, then `
When you play an episode, by casting or from the terminal, SubMiner adds the episodes around it from the same series to mpv's playlist. Move between them with mpv's playlist keys (`<` and `>` by default) or your playlist UI, and mpv moves on to the next episode when one ends. The series order runs across seasons. Each switch happens in the running mpv and overlay; nothing restarts. When you play an episode, by casting or from the terminal, SubMiner adds the episodes around it from the same series to mpv's playlist. Move between them with mpv's playlist keys (`<` and `>` by default) or your playlist UI, and mpv moves on to the next episode when one ends. The series order runs across seasons. Each switch happens in the running mpv and overlay; nothing restarts.
SubMiner waits until the first episode is playing before it looks up the others, so startup is no slower. Every episode you switch to resumes from Jellyfin's saved position and reports progress like one you picked yourself. Its subtitles load the same way. SubMiner waits until the first episode is playing before it looks up the others, so startup is no slower. Every episode you switch to resumes from Jellyfin's saved position and reports progress like one you picked yourself. Its subtitles load the same way. With mpv 0.42 or newer, the playlist lists the queued episodes by title; older mpv versions show their stream URLs.
`episodePlaylist.maxEpisodes` caps how many episodes the playlist holds, centered on the playing one. Turn `episodePlaylist.enabled` off to play one episode at a time. Changes apply from the next episode switch. `episodePlaylist.maxEpisodes` caps how many episodes the playlist holds, centered on the playing one. Turn `episodePlaylist.enabled` off to play one episode at a time. Changes apply from the next episode switch.
+21 -8
View File
@@ -32,6 +32,13 @@ async function playlistIds(mpv: E2eSession['mpv']): Promise<string[]> {
}); });
} }
// `playlist/N/title` is writable from mpv 0.42.
async function supportsPlaylistTitles(mpv: E2eSession['mpv']): Promise<boolean> {
const version = String(await mpv.command('get_property', 'mpv-version'));
const [major = 0, minor = 0] = (/v?(\d+)\.(\d+)/.exec(version) ?? []).slice(1).map(Number);
return major > 0 || minor >= 42;
}
async function mainPid(started: E2eSession): Promise<number> { async function mainPid(started: E2eSession): Promise<number> {
const main = await started.mainProcess(); const main = await started.mainProcess();
try { try {
@@ -83,19 +90,25 @@ test(
description: 'Jellyfin to hear ep2 start', description: 'Jellyfin to hear ep2 start',
timeoutMs: 30_000, timeoutMs: 30_000,
}); });
// mpv's playlist lists entry titles, not stream URLs carrying the API key. // mpv's playlist lists entry titles, not stream URLs carrying the API key. Entry titles
// became writable in mpv 0.42; older players keep listing URLs.
const titles = [ const titles = [
'E2E Show S01E01 Episode 1', 'E2E Show S01E01 Episode 1',
'E2E Show S01E02 Episode 2', 'E2E Show S01E02 Episode 2',
'E2E Show S01E03 Episode 3', 'E2E Show S01E03 Episode 3',
]; ];
await waitUntil( if (await supportsPlaylistTitles(mpv)) {
async () => { await waitUntil(
const playlist = (await mpv.command('get_property', 'playlist')) as PlaylistEntry[]; async () => {
return playlist.map((entry) => entry.title).join('|') === titles.join('|'); const playlist = (await mpv.command('get_property', 'playlist')) as PlaylistEntry[];
}, return playlist.map((entry) => entry.title).join('|') === titles.join('|');
{ description: 'queued playlist entries titled like the playing episode', timeoutMs: 10_000 }, },
); {
description: 'queued playlist entries titled like the playing episode',
timeoutMs: 10_000,
},
);
}
await mpv.command('playlist-next'); await mpv.command('playlist-next');
await waitUntil(() => reported('playing', 'ep3') >= 0, { await waitUntil(() => reported('playing', 'ep3') >= 0, {