Added type options to disable embedded subs

This commit is contained in:
Matthew Jones 2022-01-14 11:24:25 +00:00
parent 126274c4ea
commit 61d8d40a4a
2 changed files with 12 additions and 4 deletions

View File

@ -84,7 +84,9 @@ namespace MediaBrowser.Model.Configuration
public bool AutomaticallyAddToCollection { get; set; }
public bool DisableEmbeddedSubtitles { get; set; }
public bool DisableEmbeddedTextSubtitles { get; set; }
public bool DisableEmbeddedImageSubtitles { get; set; }
public TypeOptions[] TypeOptions { get; set; }

View File

@ -229,10 +229,16 @@ namespace MediaBrowser.Providers.MediaInfo
video.Video3DFormat ??= mediaInfo.Video3DFormat;
}
if (libraryOptions.DisableEmbeddedSubtitles)
if (libraryOptions.DisableEmbeddedImageSubtitles)
{
_logger.LogDebug("Disabling embedded subtitles for {Path} due to DisableEmbeddedSubtitles setting", video.Path);
mediaStreams.RemoveAll(i => i.Type == MediaStreamType.Subtitle && !i.IsExternal);
_logger.LogDebug("Disabling embedded image subtitles for {Path} due to DisableEmbeddedImageSubtitles setting", video.Path);
mediaStreams.RemoveAll(i => i.Type == MediaStreamType.Subtitle && !i.IsExternal && !i.IsTextSubtitleStream);
}
if (libraryOptions.DisableEmbeddedTextSubtitles)
{
_logger.LogDebug("Disabling embedded text subtitles for {Path} due to DisableEmbeddedTextSubtitles setting", video.Path);
mediaStreams.RemoveAll(i => i.Type == MediaStreamType.Subtitle && !i.IsExternal && i.IsTextSubtitleStream);
}
var videoStream = mediaStreams.FirstOrDefault(i => i.Type == MediaStreamType.Video);