update subtitle download setting
This commit is contained in:
parent
77e36768e4
commit
b2d1c0dee3
|
@ -2,7 +2,7 @@ namespace MediaBrowser.Model.Providers
|
||||||
{
|
{
|
||||||
public class SubtitleOptions
|
public class SubtitleOptions
|
||||||
{
|
{
|
||||||
public bool SkipIfGraphicalSubtitlesPresent { get; set; }
|
public bool SkipIfEmbeddedSubtitlesPresent { get; set; }
|
||||||
public bool SkipIfAudioTrackMatches { get; set; }
|
public bool SkipIfAudioTrackMatches { get; set; }
|
||||||
public string[] DownloadLanguages { get; set; }
|
public string[] DownloadLanguages { get; set; }
|
||||||
public bool DownloadMovieSubtitles { get; set; }
|
public bool DownloadMovieSubtitles { get; set; }
|
||||||
|
|
|
@ -532,7 +532,7 @@ namespace MediaBrowser.Providers.MediaInfo
|
||||||
_subtitleManager)
|
_subtitleManager)
|
||||||
.DownloadSubtitles(video,
|
.DownloadSubtitles(video,
|
||||||
currentStreams.Concat(externalSubtitleStreams).ToList(),
|
currentStreams.Concat(externalSubtitleStreams).ToList(),
|
||||||
subtitleOptions.SkipIfGraphicalSubtitlesPresent,
|
subtitleOptions.SkipIfEmbeddedSubtitlesPresent,
|
||||||
subtitleOptions.SkipIfAudioTrackMatches,
|
subtitleOptions.SkipIfAudioTrackMatches,
|
||||||
subtitleOptions.DownloadLanguages,
|
subtitleOptions.DownloadLanguages,
|
||||||
cancellationToken).ConfigureAwait(false);
|
cancellationToken).ConfigureAwait(false);
|
||||||
|
|
|
@ -26,7 +26,7 @@ namespace MediaBrowser.Providers.MediaInfo
|
||||||
|
|
||||||
public async Task<List<string>> DownloadSubtitles(Video video,
|
public async Task<List<string>> DownloadSubtitles(Video video,
|
||||||
List<MediaStream> mediaStreams,
|
List<MediaStream> mediaStreams,
|
||||||
bool skipIfGraphicalSubtitlesPresent,
|
bool skipIfEmbeddedSubtitlesPresent,
|
||||||
bool skipIfAudioTrackMatches,
|
bool skipIfAudioTrackMatches,
|
||||||
IEnumerable<string> languages,
|
IEnumerable<string> languages,
|
||||||
CancellationToken cancellationToken)
|
CancellationToken cancellationToken)
|
||||||
|
@ -59,7 +59,7 @@ namespace MediaBrowser.Providers.MediaInfo
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var downloaded = await DownloadSubtitles(video, mediaStreams, skipIfGraphicalSubtitlesPresent, skipIfAudioTrackMatches, lang, mediaType, cancellationToken)
|
var downloaded = await DownloadSubtitles(video, mediaStreams, skipIfEmbeddedSubtitlesPresent, skipIfAudioTrackMatches, lang, mediaType, cancellationToken)
|
||||||
.ConfigureAwait(false);
|
.ConfigureAwait(false);
|
||||||
|
|
||||||
if (downloaded)
|
if (downloaded)
|
||||||
|
@ -78,7 +78,7 @@ namespace MediaBrowser.Providers.MediaInfo
|
||||||
|
|
||||||
private async Task<bool> DownloadSubtitles(Video video,
|
private async Task<bool> DownloadSubtitles(Video video,
|
||||||
List<MediaStream> mediaStreams,
|
List<MediaStream> mediaStreams,
|
||||||
bool skipIfGraphicalSubtitlesPresent,
|
bool skipIfEmbeddedSubtitlesPresent,
|
||||||
bool skipIfAudioTrackMatches,
|
bool skipIfAudioTrackMatches,
|
||||||
string language,
|
string language,
|
||||||
VideoContentType mediaType,
|
VideoContentType mediaType,
|
||||||
|
@ -107,8 +107,8 @@ namespace MediaBrowser.Providers.MediaInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
// There's an internal subtitle stream for this language
|
// There's an internal subtitle stream for this language
|
||||||
if (skipIfGraphicalSubtitlesPresent &&
|
if (skipIfEmbeddedSubtitlesPresent &&
|
||||||
mediaStreams.Any(i => i.Type == MediaStreamType.Subtitle && !i.IsTextSubtitleStream && string.Equals(i.Language, language, StringComparison.OrdinalIgnoreCase)))
|
mediaStreams.Any(i => i.Type == MediaStreamType.Subtitle && !i.IsExternal && string.Equals(i.Language, language, StringComparison.OrdinalIgnoreCase)))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,7 +114,7 @@ namespace MediaBrowser.Providers.MediaInfo
|
||||||
_subtitleManager)
|
_subtitleManager)
|
||||||
.DownloadSubtitles(video,
|
.DownloadSubtitles(video,
|
||||||
mediaStreams,
|
mediaStreams,
|
||||||
options.SkipIfGraphicalSubtitlesPresent,
|
options.SkipIfEmbeddedSubtitlesPresent,
|
||||||
options.SkipIfAudioTrackMatches,
|
options.SkipIfAudioTrackMatches,
|
||||||
options.DownloadLanguages,
|
options.DownloadLanguages,
|
||||||
cancellationToken).ConfigureAwait(false);
|
cancellationToken).ConfigureAwait(false);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user