fix(plex): an episode with no number is named by its title on every card

The cards, the up-next card and the mark-next label printed a question
mark where Plex has no number; the player's header already showed the
title alone. One helper (episodeNumbers/episodeName) for every place.
This commit is contained in:
2026-10-08 01:16:30 +02:00
parent a504550196
commit c32429ba69
7 changed files with 93 additions and 38 deletions
+7 -2
View File
@@ -6,6 +6,7 @@ import { api } from "../lib/api";
import { plexLang } from "../i18n";
import { qk } from "../lib/queryKeys";
import { cardImage } from "../lib/plexImage";
import { episodeNumbers } from "../lib/plexDetail";
import { Button } from "./ui/Button";
import { IconButton } from "./ui/IconButton";
@@ -55,10 +56,14 @@ export function UpNextCard({
const R = 10;
const C = 2 * Math.PI * R;
// Title: "Show · S2·E5" over the episode title for episodes; the plain title for movies/queue items.
// Title: "Show · S2·E5" over the episode title for episodes (the show alone when Plex has no
// number for the episode); the plain title for movies/queue items.
const nums = next ? episodeNumbers(next) : null;
const heading =
next?.kind === "episode" && next.show_title
? `${next.show_title} · S${next.season_number ?? "?"}·E${next.episode_number ?? "?"}`
? nums
? `${next.show_title} · S${nums.season}·E${nums.episode}`
: next.show_title
: (next?.title ?? "");
const sub = next?.kind === "episode" ? next.title : null;