From 5083e748ed409c74d57f02c35534a02a2f28a800 Mon Sep 17 00:00:00 2001 From: Jason Dove <1695733+jasongdove@users.noreply.github.com> Date: Fri, 7 Nov 2025 13:30:37 -0600 Subject: [PATCH] fix mpegts script loading (#2610) --- CHANGELOG.md | 1 + ErsatzTV.Core/FFmpeg/FFmpegLibraryProcessService.cs | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 46ae59ba8..5c3dc90d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - This allows using something other than ffmpeg (e.g. streamlink) to concatenate segments back together when using MPEG-TS streaming mode - Scripts live in config / scripts / mpegts - Each script gets its own subfolder which contains an `mpegts.yml` definition and corresponding windows (powershell) and linux (bash) scripts + - The global MPEG-TS script can be configured in **Settings** > **FFmpeg** > **Default MPEG-TS Script** ### Fixed - Fix HLS Direct playback with Jellyfin 10.11 diff --git a/ErsatzTV.Core/FFmpeg/FFmpegLibraryProcessService.cs b/ErsatzTV.Core/FFmpeg/FFmpegLibraryProcessService.cs index 9d6e1d176..e39e74a17 100644 --- a/ErsatzTV.Core/FFmpeg/FFmpegLibraryProcessService.cs +++ b/ErsatzTV.Core/FFmpeg/FFmpegLibraryProcessService.cs @@ -849,10 +849,8 @@ public class FFmpegLibraryProcessService : IFFmpegProcessService .GetValue(ConfigElementKey.FFmpegDefaultMpegTsScript, cancellationToken) .IfNoneAsync("Default"); List allScripts = _mpegTsScriptService.GetScripts(); - foreach (var script in allScripts.Where(s => string.Equals( - s.Name, - defaultScript, - StringComparison.OrdinalIgnoreCase))) + Option maybeScript = Optional(allScripts.Find(s => s.Id == defaultScript)); + foreach (var script in maybeScript) { Option maybeCommand = await _mpegTsScriptService.Execute( script, @@ -865,6 +863,11 @@ public class FFmpegLibraryProcessService : IFFmpegProcessService } } + if (maybeScript.IsNone) + { + _logger.LogWarning("Unable to locate MPEG-TS Script in folder {Id}", defaultScript); + } + IPipelineBuilder pipelineBuilder = await _pipelineBuilderFactory.GetBuilder( HardwareAccelerationMode.None, Option.None,