refactor(plex): share showEpisodeKeys + honest empty Play-all

Extract the show->ordered-episode-keys flatten into one pure, unit-tested
helper (lib/plexQueue.ts) and use it at all three sites — the collection
Play-all (S4) and the show/season play-through pages in plexViews — so the
season-then-episode queue-order invariant lives in one place instead of three
hand-rolled copies. Behaviour-identical (the helper's ?? [] is a safe superset
of the collection site's previously non-null read).

Also: a show-collection whose shows expand to zero episodes had an enabled
Play-all that silently no-op'd — the same 'does nothing' state S4 removed for
the empty-queue case. Surface an honest info notice (plex.collection.playEmpty,
HU+EN) instead.
This commit is contained in:
2026-08-24 22:09:52 +02:00
parent 852b227ea2
commit 2e319be569
6 changed files with 53 additions and 3 deletions
+1
View File
@@ -24,6 +24,7 @@
"deleteConfirm": "Delete the collection \"{{title}}\"? This removes it from Plex too.",
"editFailed": "Collection edit failed",
"playFailed": "Couldn't build the play queue — try again.",
"playEmpty": "Nothing to play in this collection yet.",
"newCollection": "New collection",
"namePlaceholder": "Collection name",
"nameTaken": "A collection with this name already exists.",
+1
View File
@@ -24,6 +24,7 @@
"deleteConfirm": "Törlöd a(z) „{{title}}” kollekciót? Ez a Plexből is eltávolítja.",
"editFailed": "A kollekció szerkesztése sikertelen",
"playFailed": "Nem sikerült összeállítani a lejátszási sort — próbáld újra.",
"playEmpty": "Ebben a kollekcióban még nincs mit lejátszani.",
"newCollection": "Új kollekció",
"namePlaceholder": "Kollekció neve",
"nameTaken": "Már létezik ilyen nevű kollekció.",