diff --git a/MediaBrowser.Model/Configuration/EmbeddedSubtitleOptions.cs b/MediaBrowser.Model/Configuration/EmbeddedSubtitleOptions.cs new file mode 100644 index 0000000000..948027603f --- /dev/null +++ b/MediaBrowser.Model/Configuration/EmbeddedSubtitleOptions.cs @@ -0,0 +1,30 @@ +namespace MediaBrowser.Model.Configuration +{ + /// + /// An enum representing the options to disable embedded subs. + /// + public enum EmbeddedSubtitleOptions + { + + /// + /// Allow all embedded subs. + /// + AllowAll, + + /// + /// Allow only embedded subs that are text based. + /// + AllowText, + + /// + /// Allow only embedded subs that are image based. + /// + AllowImage, + + /// + /// Disable all embedded subs. + /// + AllowNone, + } + +} diff --git a/MediaBrowser.Model/Configuration/LibraryOptions.cs b/MediaBrowser.Model/Configuration/LibraryOptions.cs index efa63b5e16..ad3bce86ea 100644 --- a/MediaBrowser.Model/Configuration/LibraryOptions.cs +++ b/MediaBrowser.Model/Configuration/LibraryOptions.cs @@ -15,6 +15,7 @@ namespace MediaBrowser.Model.Configuration SkipSubtitlesIfAudioTrackMatches = true; RequirePerfectSubtitleMatch = true; + AllowEmbeddedSubtitles = EmbeddedSubtitleOptions.AllowAll; AutomaticallyAddToCollection = true; EnablePhotos = true; @@ -84,9 +85,7 @@ namespace MediaBrowser.Model.Configuration public bool AutomaticallyAddToCollection { get; set; } - public bool DisableEmbeddedTextSubtitles { get; set; } - - public bool DisableEmbeddedImageSubtitles { get; set; } + public EmbeddedSubtitleOptions AllowEmbeddedSubtitles { get; set; } public TypeOptions[] TypeOptions { get; set; } diff --git a/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs b/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs index c1145f8a2a..71cdc5bffd 100644 --- a/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs +++ b/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs @@ -229,13 +229,13 @@ namespace MediaBrowser.Providers.MediaInfo video.Video3DFormat ??= mediaInfo.Video3DFormat; } - if (libraryOptions.DisableEmbeddedImageSubtitles) + if (libraryOptions.AllowEmbeddedSubtitles == EmbeddedSubtitleOptions.AllowText || libraryOptions.AllowEmbeddedSubtitles == EmbeddedSubtitleOptions.AllowNone) { _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) + if (libraryOptions.AllowEmbeddedSubtitles == EmbeddedSubtitleOptions.AllowImage || libraryOptions.AllowEmbeddedSubtitles == EmbeddedSubtitleOptions.AllowNone) { _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);