rename subtitle config property

This commit is contained in:
Luke Pulverenti 2014-05-07 16:24:34 -04:00
parent d5b1730a7a
commit c183edc238
4 changed files with 12 additions and 8 deletions

View file

@ -318,7 +318,7 @@ namespace MediaBrowser.Model.Configuration
public class SubtitleOptions public class SubtitleOptions
{ {
public bool RequireExternalSubtitles { get; set; } public bool RequireTextSubtitles { get; set; }
public string[] DownloadLanguages { get; set; } public string[] DownloadLanguages { get; set; }
public bool DownloadMovieSubtitles { get; set; } public bool DownloadMovieSubtitles { get; set; }
public bool DownloadEpisodeSubtitles { get; set; } public bool DownloadEpisodeSubtitles { get; set; }

View file

@ -472,7 +472,7 @@ namespace MediaBrowser.Providers.MediaInfo
.DownloadSubtitles(video, .DownloadSubtitles(video,
currentStreams, currentStreams,
externalSubtitleStreams, externalSubtitleStreams,
_config.Configuration.SubtitleOptions.RequireExternalSubtitles, _config.Configuration.SubtitleOptions.RequireTextSubtitles,
_config.Configuration.SubtitleOptions.DownloadLanguages, _config.Configuration.SubtitleOptions.DownloadLanguages,
cancellationToken).ConfigureAwait(false); cancellationToken).ConfigureAwait(false);

View file

@ -24,7 +24,7 @@ namespace MediaBrowser.Providers.MediaInfo
} }
public async Task<List<string>> DownloadSubtitles(Video video, public async Task<List<string>> DownloadSubtitles(Video video,
List<MediaStream> internalSubtitleStreams, List<MediaStream> internalMediaStreams,
List<MediaStream> externalSubtitleStreams, List<MediaStream> externalSubtitleStreams,
bool forceExternal, bool forceExternal,
IEnumerable<string> languages, IEnumerable<string> languages,
@ -58,7 +58,7 @@ namespace MediaBrowser.Providers.MediaInfo
{ {
try 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); .ConfigureAwait(false);
if (downloaded) if (downloaded)
@ -76,7 +76,7 @@ namespace MediaBrowser.Providers.MediaInfo
} }
private async Task<bool> DownloadSubtitles(Video video, private async Task<bool> DownloadSubtitles(Video video,
IEnumerable<MediaStream> internalSubtitleStreams, List<MediaStream> internalMediaStreams,
IEnumerable<MediaStream> externalSubtitleStreams, IEnumerable<MediaStream> externalSubtitleStreams,
bool forceExternal, bool forceExternal,
string language, string language,
@ -89,8 +89,12 @@ namespace MediaBrowser.Providers.MediaInfo
return false; return false;
} }
var internalAudioStreams = internalMediaStreams.Where(i => i.Type == MediaStreamType.Audio)
.ToList();
// There's an internal subtitle stream for this language // 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; return false;
} }

View file

@ -707,8 +707,8 @@
"OptionReportByteRangeSeekingWhenTranscodingHelp": "This is required for some devices that don't time seek very well.", "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.", "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:", "HeaderDownloadSubtitlesFor": "Download subtitles for:",
"LabelRequireExternalSubtitles": "Download even if the video already contains graphical subtitles", "LabelRequireTextSubtitles": "Download even if the video already contains graphical subtitles",
"LabelRequireExternalSubtitlesHelp": "Keeping text versions of subtitles will result in more efficient delivery to mobile clients.", "LabelRequireTextSubtitlesHelp": "Keeping text versions of subtitles will result in more efficient delivery to mobile clients.",
"TabSubtitles": "Subtitles", "TabSubtitles": "Subtitles",
"LabelOpenSubtitlesUsername": "Open Subtitles username:", "LabelOpenSubtitlesUsername": "Open Subtitles username:",
"LabelOpenSubtitlesPassword": "Open Subtitles password:", "LabelOpenSubtitlesPassword": "Open Subtitles password:",