From fb37a9209643e5f12f757bc613abd265a718b4bc Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 20 Sep 2026 15:24:33 +0000 Subject: [PATCH 1/3] Fix TwitchDownloaderCLI detection: add libicu76 and remove bogus shell redirect arg - Remove "2>&1" from TwitchDownloader version_args in Software.ts; it was passed as a literal argument to spawn() rather than interpreted as a shell redirect, causing the version regex to fail to match - Add libicu76 to apt-get install in Dockerfile; TwitchDownloaderCLI is a .NET 8 self-contained binary that requires ICU libraries for globalization, which were missing from the Debian Trixie slim image (the old Alpine config explicitly included icu-libs but the migration dropped it) - Update docker-compose.yml image reference to ghcr.io/second2falcon/livestreamdvr:latest Co-Authored-By: Claude Sonnet 4.6 Claude-Session: https://claude.ai/code/session_018ynVqCD9HyYB2nSqpTUwFa --- Dockerfile | 1 + docker-compose.yml | 2 +- server/src/Helpers/Software.ts | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1578325e..4094eab6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,6 +28,7 @@ RUN apt-get update && apt-get install -y \ ffmpeg mediainfo \ python3 python3-pip python3-wheel libxml2-dev libxslt-dev python3-dev \ bash git curl unzip rclone \ + libicu76 \ && apt-get clean # copy over pipenv files and install dependencies for python diff --git a/docker-compose.yml b/docker-compose.yml index 5e69e6ba..4e585141 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.8" services: web: build: . - image: mrbrax/twitchautomator:master + image: ghcr.io/second2falcon/livestreamdvr:latest ports: - "8082:8080" volumes: diff --git a/server/src/Helpers/Software.ts b/server/src/Helpers/Software.ts index a62f1679..af9f89bd 100644 --- a/server/src/Helpers/Software.ts +++ b/server/src/Helpers/Software.ts @@ -27,7 +27,7 @@ export function DVRBinaries(): Record { }, twitchdownloader: { binary: Helper.path_twitchdownloader(), - version_args: ["--version", "2>&1"], + version_args: ["--version"], version_regex: /TwitchDownloaderCLI (\d+\.\d+\.\d+)/m, }, python: { From f82726ac27d735bea9d9412079cf4dba8b30c454 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 20 Sep 2026 15:35:25 +0000 Subject: [PATCH 2/3] Fall back to VOD chapters for GetHistory when no live-capture history file exists Channels imported from another system never trigger the live-capture writes that build the per-channel .jsonline history file, so Fetch History always returned 400 "No history found" for them even with 77 recorded VODs. When the history file is absent, collect chapters_raw from all of the channel's loaded VODs, sort them by started_at, and return those instead. The 400 error is preserved only when there are genuinely no VODs with chapters either. Co-Authored-By: Claude Sonnet 4.6 Claude-Session: https://claude.ai/code/session_018ynVqCD9HyYB2nSqpTUwFa --- server/src/Controllers/Channels.ts | 42 +++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/server/src/Controllers/Channels.ts b/server/src/Controllers/Channels.ts index 4c453a7c..ce14148b 100644 --- a/server/src/Controllers/Channels.ts +++ b/server/src/Controllers/Channels.ts @@ -1779,20 +1779,36 @@ export function GetHistory(req: express.Request, res: express.Response): void { BaseConfigCacheFolder.history, `${channel.internalName}.jsonline` ); - if (!fs.existsSync(file)) { - res.api(400, { - status: "ERROR", - message: req.t("route.channels.no-history-found"), - }); - return; - } - - const lines = fs.readFileSync(file, "utf8").split("\n"); - for (const line of lines) { - if (line.length > 0) { - const chapter = JSON.parse(line) as HistoryEntry; - history.push(chapter); + if (fs.existsSync(file)) { + const lines = fs.readFileSync(file, "utf8").split("\n"); + for (const line of lines) { + if (line.length > 0) { + const chapter = JSON.parse(line) as HistoryEntry; + history.push(chapter); + } } + } else { + // Fall back to building history from existing VOD chapters for imported channels + const vods = channel.getVods(); + for (const vod of vods) { + if (isTwitchChannel(channel) && vod instanceof TwitchVOD) { + for (const chapter of vod.chapters_raw) { + history.push(chapter); + } + } + } + if (history.length === 0) { + res.api(400, { + status: "ERROR", + message: req.t("route.channels.no-history-found"), + }); + return; + } + history.sort((a, b) => { + const aTime = (a as TwitchVODChapterJSON).started_at ?? (a as StreamEvent).time ?? ""; + const bTime = (b as TwitchVODChapterJSON).started_at ?? (b as StreamEvent).time ?? ""; + return aTime < bTime ? -1 : aTime > bTime ? 1 : 0; + }); } res.api(200, { From 3cdd99c13640f3e2bca7f6ad0e1d20f1a5c478b1 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 20 Sep 2026 15:37:04 +0000 Subject: [PATCH 3/3] Limit VOD-chapter history fallback to last 5 recordings Co-Authored-By: Claude Sonnet 4.6 Claude-Session: https://claude.ai/code/session_018ynVqCD9HyYB2nSqpTUwFa --- server/src/Controllers/Channels.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/Controllers/Channels.ts b/server/src/Controllers/Channels.ts index ce14148b..8cc491b5 100644 --- a/server/src/Controllers/Channels.ts +++ b/server/src/Controllers/Channels.ts @@ -1788,8 +1788,8 @@ export function GetHistory(req: express.Request, res: express.Response): void { } } } else { - // Fall back to building history from existing VOD chapters for imported channels - const vods = channel.getVods(); + // Fall back to building history from the last 5 VODs' chapters for imported channels + const vods = channel.getVods().slice(-5); for (const vod of vods) { if (isTwitchChannel(channel) && vod instanceof TwitchVOD) { for (const chapter of vod.chapters_raw) {