From 7a133d46da43fc4a0aa1993fb54247f6c7d84477 Mon Sep 17 00:00:00 2001 From: Jason Dove <1695733+jasongdove@users.noreply.github.com> Date: Tue, 28 Oct 2025 12:57:13 -0500 Subject: [PATCH] fix remote stream scripts (#2573) --- CHANGELOG.md | 1 + ErsatzTV/Controllers/InternalController.cs | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0b904b5c..87618223b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] ### Fixed - Fix HLS Direct playback with Jellyfin 10.11 +- Fix remote stream scripts (parsing issue with spaces and quotes) ## [25.8.0] - 2025-10-26 ### Added diff --git a/ErsatzTV/Controllers/InternalController.cs b/ErsatzTV/Controllers/InternalController.cs index 77f6c3845..5b2dbf44c 100644 --- a/ErsatzTV/Controllers/InternalController.cs +++ b/ErsatzTV/Controllers/InternalController.cs @@ -1,4 +1,5 @@ -using System.Diagnostics; +using System.CommandLine.Parsing; +using System.Diagnostics; using CliWrap; using ErsatzTV.Application.Emby; using ErsatzTV.Application.Jellyfin; @@ -59,13 +60,13 @@ public class InternalController : StreamingControllerBase if (!string.IsNullOrWhiteSpace(remoteStream.Script)) { - string[] split = remoteStream.Script.Split(" "); - if (split.Length > 0) + var split = CommandLineParser.SplitCommandLine(remoteStream.Script).ToList(); + if (split.Count > 0) { - _logger.LogDebug("Remote stream script: {Arguments}", split.ToList()); + _logger.LogDebug("Remote stream script: {Arguments}", split); Command command = Cli.Wrap(split.Head()); - if (split.Length > 1) + if (split.Count > 1) { command = command.WithArguments(split.Tail()); }