Browse Source

fix external subtitle playback on windows (#1256)

pull/1259/head
Jason Dove 3 years ago committed by GitHub
parent
commit
30850329f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 8
      ErsatzTV.FFmpeg/Filter/SubtitlesFilter.cs
  3. 12
      ErsatzTV/Pages/ScheduleItemsEditor.razor
  4. 3
      ErsatzTV/Program.cs

1
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 - 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 bug where deleting a channel would not remove its data from XMLTV
- Fix colorspace filter for some files with invalid color metadata - Fix colorspace filter for some files with invalid color metadata
- Fix playback of external subtitles on Windows
### Changed ### Changed
- Remove duplicate items from smart collections before scheduling - Remove duplicate items from smart collections before scheduling

8
ErsatzTV.FFmpeg/Filter/SubtitlesFilter.cs

@ -27,8 +27,12 @@ public class SubtitlesFilter : BaseFilter
.Replace(@":/", @"\\:/"); .Replace(@":/", @"\\:/");
effectiveFile = effectiveFile effectiveFile = effectiveFile
.Replace(@"\", @"/\") .Replace(@"\", @"/\");
.Replace(@":/", @"\\:/");
if (!effectiveFile.StartsWith("http"))
{
effectiveFile = effectiveFile.Replace(@":/", @"\\:/");
}
} }
// escape brackets after escaping for windows // escape brackets after escaping for windows

12
ErsatzTV/Pages/ScheduleItemsEditor.razor

@ -114,7 +114,7 @@
{ {
<MudAutocomplete Class="mt-3" T="MediaCollectionViewModel" Label="Collection" <MudAutocomplete Class="mt-3" T="MediaCollectionViewModel" Label="Collection"
@bind-Value="_selectedItem.Collection" SearchFunc="@SearchCollections" @bind-Value="_selectedItem.Collection" SearchFunc="@SearchCollections"
ToStringFunc="@(c=> c.Name)" Placeholder="Type to search..."> ToStringFunc="@(c=> c?.Name)" Placeholder="Type to search...">
<MoreItemsTemplate> <MoreItemsTemplate>
<MudText Align="Align.Center" Class="px-4 py-1"> <MudText Align="Align.Center" Class="px-4 py-1">
Only the first 10 items are shown Only the first 10 items are shown
@ -126,7 +126,7 @@
{ {
<MudAutocomplete Class="mt-3" T="MultiCollectionViewModel" Label="Multi Collection" <MudAutocomplete Class="mt-3" T="MultiCollectionViewModel" Label="Multi Collection"
@bind-Value="_selectedItem.MultiCollection" SearchFunc="@SearchMultiCollections" @bind-Value="_selectedItem.MultiCollection" SearchFunc="@SearchMultiCollections"
ToStringFunc="@(c=> c.Name)" Placeholder="Type to search..."> ToStringFunc="@(c=> c?.Name)" Placeholder="Type to search...">
<MoreItemsTemplate> <MoreItemsTemplate>
<MudText Align="Align.Center" Class="px-4 py-1"> <MudText Align="Align.Center" Class="px-4 py-1">
Only the first 10 items are shown Only the first 10 items are shown
@ -138,7 +138,7 @@
{ {
<MudAutocomplete Class="mt-3" T="SmartCollectionViewModel" Label="Smart Collection" <MudAutocomplete Class="mt-3" T="SmartCollectionViewModel" Label="Smart Collection"
@bind-Value="_selectedItem.SmartCollection" SearchFunc="@SearchSmartCollections" @bind-Value="_selectedItem.SmartCollection" SearchFunc="@SearchSmartCollections"
ToStringFunc="@(c=> c.Name)" Placeholder="Type to search..."> ToStringFunc="@(c=> c?.Name)" Placeholder="Type to search...">
<MoreItemsTemplate> <MoreItemsTemplate>
<MudText Align="Align.Center" Class="px-4 py-1"> <MudText Align="Align.Center" Class="px-4 py-1">
Only the first 10 items are shown Only the first 10 items are shown
@ -150,7 +150,7 @@
{ {
<MudAutocomplete Class="mt-3" T="NamedMediaItemViewModel" Label="Television Show" <MudAutocomplete Class="mt-3" T="NamedMediaItemViewModel" Label="Television Show"
@bind-Value="_selectedItem.MediaItem" SearchFunc="@SearchTelevisionShows" @bind-Value="_selectedItem.MediaItem" SearchFunc="@SearchTelevisionShows"
ToStringFunc="@(c=> c.Name)" Placeholder="Type to search..."> ToStringFunc="@(c=> c?.Name)" Placeholder="Type to search...">
<MoreItemsTemplate> <MoreItemsTemplate>
<MudText Align="Align.Center" Class="px-4 py-1"> <MudText Align="Align.Center" Class="px-4 py-1">
Only the first 10 items are shown Only the first 10 items are shown
@ -162,7 +162,7 @@
{ {
<MudAutocomplete Class="mt-3" T="NamedMediaItemViewModel" Label="Television Season" <MudAutocomplete Class="mt-3" T="NamedMediaItemViewModel" Label="Television Season"
@bind-Value="_selectedItem.MediaItem" SearchFunc="@SearchTelevisionSeasons" @bind-Value="_selectedItem.MediaItem" SearchFunc="@SearchTelevisionSeasons"
ToStringFunc="@(c=> c.Name)" Placeholder="Type to search..." ToStringFunc="@(c=> c?.Name)" Placeholder="Type to search..."
MaxItems="20"> MaxItems="20">
<MoreItemsTemplate> <MoreItemsTemplate>
<MudText Align="Align.Center" Class="px-4 py-1"> <MudText Align="Align.Center" Class="px-4 py-1">
@ -175,7 +175,7 @@
{ {
<MudAutocomplete Class="mt-3" T="NamedMediaItemViewModel" Label="Artist" <MudAutocomplete Class="mt-3" T="NamedMediaItemViewModel" Label="Artist"
@bind-Value="_selectedItem.MediaItem" SearchFunc="@SearchArtists" @bind-Value="_selectedItem.MediaItem" SearchFunc="@SearchArtists"
ToStringFunc="@(c=> c.Name)" Placeholder="Type to search..." ToStringFunc="@(c=> c?.Name)" Placeholder="Type to search..."
MaxItems="10"> MaxItems="10">
<MoreItemsTemplate> <MoreItemsTemplate>
<MudText Align="Align.Center" Class="px-4 py-1"> <MudText Align="Align.Center" Class="px-4 py-1">

3
ErsatzTV/Program.cs

@ -1,3 +1,4 @@
using System.Diagnostics;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using Destructurama; using Destructurama;
using ErsatzTV.Core; using ErsatzTV.Core;
@ -52,7 +53,7 @@ public class Program
.WriteTo.File(FileSystemLayout.LogFilePath, rollingInterval: RollingInterval.Day); .WriteTo.File(FileSystemLayout.LogFilePath, rollingInterval: RollingInterval.Day);
// for performance reasons, restrict windows console to error logs // 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( loggerConfiguration = loggerConfiguration.WriteTo.Console(
restrictedToMinimumLevel: LogEventLevel.Error, restrictedToMinimumLevel: LogEventLevel.Error,

Loading…
Cancel
Save