Add DisableEmbeddedSubtitles setting

Disables embedded subs being added to metadata
This commit is contained in:
Matthew Jones 2021-12-26 16:18:25 +00:00
parent 07e9568de8
commit 4df7590e52
2 changed files with 8 additions and 0 deletions

View File

@ -84,6 +84,8 @@ namespace MediaBrowser.Model.Configuration
public bool AutomaticallyAddToCollection { get; set; } public bool AutomaticallyAddToCollection { get; set; }
public bool DisableEmbeddedSubtitles { get; set; }
public TypeOptions[] TypeOptions { get; set; } public TypeOptions[] TypeOptions { get; set; }
public TypeOptions? GetTypeOptions(string type) public TypeOptions? GetTypeOptions(string type)

View File

@ -229,6 +229,12 @@ namespace MediaBrowser.Providers.MediaInfo
video.Video3DFormat ??= mediaInfo.Video3DFormat; video.Video3DFormat ??= mediaInfo.Video3DFormat;
} }
if (libraryOptions.DisableEmbeddedSubtitles)
{
_logger.LogInformation("Disabling embedded subtitles due to DisableEmbeddedSubtitles setting.");
mediaStreams.RemoveAll(i => i.Type == MediaStreamType.Subtitle && !i.IsExternal);
}
var videoStream = mediaStreams.FirstOrDefault(i => i.Type == MediaStreamType.Video); var videoStream = mediaStreams.FirstOrDefault(i => i.Type == MediaStreamType.Video);
video.Height = videoStream?.Height ?? 0; video.Height = videoStream?.Height ?? 0;