diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs index ae801f53f..e92d33574 100644 --- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -318,7 +318,7 @@ namespace MediaBrowser.Model.Configuration public class SubtitleOptions { - public bool RequireExternalSubtitles { get; set; } + public bool RequireTextSubtitles { get; set; } public string[] DownloadLanguages { get; set; } public bool DownloadMovieSubtitles { get; set; } public bool DownloadEpisodeSubtitles { get; set; } diff --git a/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs b/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs index ad222aca5..a78c27aa4 100644 --- a/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs +++ b/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs @@ -472,7 +472,7 @@ namespace MediaBrowser.Providers.MediaInfo .DownloadSubtitles(video, currentStreams, externalSubtitleStreams, - _config.Configuration.SubtitleOptions.RequireExternalSubtitles, + _config.Configuration.SubtitleOptions.RequireTextSubtitles, _config.Configuration.SubtitleOptions.DownloadLanguages, cancellationToken).ConfigureAwait(false); diff --git a/MediaBrowser.Providers/MediaInfo/SubtitleDownloader.cs b/MediaBrowser.Providers/MediaInfo/SubtitleDownloader.cs index 7f7ccda19..b9a23449a 100644 --- a/MediaBrowser.Providers/MediaInfo/SubtitleDownloader.cs +++ b/MediaBrowser.Providers/MediaInfo/SubtitleDownloader.cs @@ -24,7 +24,7 @@ namespace MediaBrowser.Providers.MediaInfo } public async Task> DownloadSubtitles(Video video, - List internalSubtitleStreams, + List internalMediaStreams, List externalSubtitleStreams, bool forceExternal, IEnumerable languages, @@ -58,7 +58,7 @@ namespace MediaBrowser.Providers.MediaInfo { try { - var downloaded = await DownloadSubtitles(video, internalSubtitleStreams, externalSubtitleStreams, forceExternal, lang, mediaType, cancellationToken) + var downloaded = await DownloadSubtitles(video, internalMediaStreams, externalSubtitleStreams, forceExternal, lang, mediaType, cancellationToken) .ConfigureAwait(false); if (downloaded) @@ -76,7 +76,7 @@ namespace MediaBrowser.Providers.MediaInfo } private async Task DownloadSubtitles(Video video, - IEnumerable internalSubtitleStreams, + List internalMediaStreams, IEnumerable externalSubtitleStreams, bool forceExternal, string language, @@ -89,8 +89,12 @@ namespace MediaBrowser.Providers.MediaInfo return false; } + var internalAudioStreams = internalMediaStreams.Where(i => i.Type == MediaStreamType.Audio) + .ToList(); + // There's an internal subtitle stream for this language - if (!forceExternal && internalSubtitleStreams.Any(i => string.Equals(i.Language, language, StringComparison.OrdinalIgnoreCase))) + if (!forceExternal && + internalMediaStreams.Any(i => i.Type == MediaStreamType.Subtitle && string.Equals(i.Language, language, StringComparison.OrdinalIgnoreCase))) { return false; } diff --git a/MediaBrowser.Server.Implementations/Localization/Server/server.json b/MediaBrowser.Server.Implementations/Localization/Server/server.json index 5f128ea22..79e2697dd 100644 --- a/MediaBrowser.Server.Implementations/Localization/Server/server.json +++ b/MediaBrowser.Server.Implementations/Localization/Server/server.json @@ -707,8 +707,8 @@ "OptionReportByteRangeSeekingWhenTranscodingHelp": "This is required for some devices that don't time seek very well.", "HeaderSubtitleDownloadingHelp": "Media Browser can inspect your video files for missing subtitles, and download them using a subtitle provider such as OpenSubtitles.org.", "HeaderDownloadSubtitlesFor": "Download subtitles for:", - "LabelRequireExternalSubtitles": "Download even if the video already contains graphical subtitles", - "LabelRequireExternalSubtitlesHelp": "Keeping text versions of subtitles will result in more efficient delivery to mobile clients.", + "LabelRequireTextSubtitles": "Download even if the video already contains graphical subtitles", + "LabelRequireTextSubtitlesHelp": "Keeping text versions of subtitles will result in more efficient delivery to mobile clients.", "TabSubtitles": "Subtitles", "LabelOpenSubtitlesUsername": "Open Subtitles username:", "LabelOpenSubtitlesPassword": "Open Subtitles password:",