From 30850329f3bb1d142e77ab5c8348ad8ba8835dd2 Mon Sep 17 00:00:00 2001 From: Jason Dove <1695733+jasongdove@users.noreply.github.com> Date: Sun, 23 Apr 2023 09:53:57 -0500 Subject: [PATCH] fix external subtitle playback on windows (#1256) --- CHANGELOG.md | 1 + ErsatzTV.FFmpeg/Filter/SubtitlesFilter.cs | 8 ++++++-- ErsatzTV/Pages/ScheduleItemsEditor.razor | 12 ++++++------ ErsatzTV/Program.cs | 3 ++- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4c30495f..61d7c0596 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Properly extract and burn in embedded text subtitles using Jellyfin, Emby and Plex libraries - Fix bug where deleting a channel would not remove its data from XMLTV - Fix colorspace filter for some files with invalid color metadata +- Fix playback of external subtitles on Windows ### Changed - Remove duplicate items from smart collections before scheduling diff --git a/ErsatzTV.FFmpeg/Filter/SubtitlesFilter.cs b/ErsatzTV.FFmpeg/Filter/SubtitlesFilter.cs index e14abfb82..c70cc935e 100644 --- a/ErsatzTV.FFmpeg/Filter/SubtitlesFilter.cs +++ b/ErsatzTV.FFmpeg/Filter/SubtitlesFilter.cs @@ -27,8 +27,12 @@ public class SubtitlesFilter : BaseFilter .Replace(@":/", @"\\:/"); effectiveFile = effectiveFile - .Replace(@"\", @"/\") - .Replace(@":/", @"\\:/"); + .Replace(@"\", @"/\"); + + if (!effectiveFile.StartsWith("http")) + { + effectiveFile = effectiveFile.Replace(@":/", @"\\:/"); + } } // escape brackets after escaping for windows diff --git a/ErsatzTV/Pages/ScheduleItemsEditor.razor b/ErsatzTV/Pages/ScheduleItemsEditor.razor index 378da1be5..46df5a159 100644 --- a/ErsatzTV/Pages/ScheduleItemsEditor.razor +++ b/ErsatzTV/Pages/ScheduleItemsEditor.razor @@ -114,7 +114,7 @@ { + ToStringFunc="@(c=> c?.Name)" Placeholder="Type to search..."> Only the first 10 items are shown @@ -126,7 +126,7 @@ { + ToStringFunc="@(c=> c?.Name)" Placeholder="Type to search..."> Only the first 10 items are shown @@ -138,7 +138,7 @@ { + ToStringFunc="@(c=> c?.Name)" Placeholder="Type to search..."> Only the first 10 items are shown @@ -150,7 +150,7 @@ { + ToStringFunc="@(c=> c?.Name)" Placeholder="Type to search..."> Only the first 10 items are shown @@ -162,7 +162,7 @@ { @@ -175,7 +175,7 @@ { diff --git a/ErsatzTV/Program.cs b/ErsatzTV/Program.cs index b5948e00c..f339759a8 100644 --- a/ErsatzTV/Program.cs +++ b/ErsatzTV/Program.cs @@ -1,3 +1,4 @@ +using System.Diagnostics; using System.Runtime.InteropServices; using Destructurama; using ErsatzTV.Core; @@ -52,7 +53,7 @@ public class Program .WriteTo.File(FileSystemLayout.LogFilePath, rollingInterval: RollingInterval.Day); // for performance reasons, restrict windows console to error logs - if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && !Debugger.IsAttached) { loggerConfiguration = loggerConfiguration.WriteTo.Console( restrictedToMinimumLevel: LogEventLevel.Error,