fix(card): a total's left-out videos are "without length", not "live"

The count holds archives and upcoming streams too, which a card names a stream or upcoming.
This commit is contained in:
2026-11-07 21:58:36 +01:00
parent 90931b4750
commit 872b583f06
7 changed files with 10 additions and 9 deletions
@@ -10,7 +10,7 @@ export function isLiveWithoutLength(v: Pick<Video, "duration_seconds" | "live_st
return v.duration_seconds == null && v.live_status !== "none";
}
/** "12 hr 5 min +2 live": `total` is the formatted sum ("" when nothing summed), `live` the count
/** "12 hr 5 min +2 without length": `total` is the formatted sum ("" when nothing summed), `live` the count
* it left out. Empty when both are. */
export function withLiveCount(total: string, live: number, t: TFunction): string {
const suffix = live > 0 ? t("card.liveWithoutLength", { count: live }) : "";
+2 -2
View File
@@ -16,8 +16,8 @@
"restart": "Restart",
"play": "Play",
"stream": "stream",
"liveWithoutLength_one": "+{{count}} live",
"liveWithoutLength_other": "+{{count}} live",
"liveWithoutLength_one": "+{{count}} without length",
"liveWithoutLength_other": "+{{count}} without length",
"views": "views",
"info": "Details",
"noDescription": "No description",
+2 -2
View File
@@ -16,8 +16,8 @@
"restart": "Elölről",
"play": "Lejátszás",
"stream": "közvetítés",
"liveWithoutLength_one": "+{{count}} élő",
"liveWithoutLength_other": "+{{count}} élő",
"liveWithoutLength_one": "+{{count}} hossz nélkül",
"liveWithoutLength_other": "+{{count}} hossz nélkül",
"views": "megtekintés",
"info": "Részletek",
"noDescription": "Nincs leírás",
+1 -1
View File
@@ -77,7 +77,7 @@ export interface ManagedChannel {
* subscribe made here. */
added_at: string;
total_duration_seconds: number;
/** Live videos the total cannot hold (no length): the "+N live" beside it. */
/** Live videos the total cannot hold (no length): the "+N without length" beside it. */
live_without_length: number;
priority: number;
hidden: boolean;
+1 -1
View File
@@ -17,7 +17,7 @@ export interface Playlist {
dirty: boolean; // linked local playlist has edits not yet pushed to YouTube
item_count: number;
total_duration_seconds: number;
/** Live videos the total cannot hold (no length): the "+N live" beside it. */
/** Live videos the total cannot hold (no length): the "+N without length" beside it. */
live_without_length: number;
cover_thumbnail: string | null;
updated_at: string; // ISO; when the list last CHANGED (rename, add/remove/move/reorder)
+1 -1
View File
@@ -567,7 +567,7 @@ function PlaylistDetail() {
// Total playtime of the whole playlist (sums every item, matching the itemCount beside it — not
// the filtered `shown` set). Items with an unknown duration count as 0, and a live one is named
// beside the sum instead ("+2 live"); hidden when there is neither.
// beside the sum instead ("+2 without length"); hidden when there is neither.
const totalSeconds = useMemo(
() => items.reduce((acc, v) => acc + (v.duration_seconds ?? 0), 0),
[items],