From d6ce2eacb51ecc9730fb02da52cb3bdf3cd361b0 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 9 May 2014 00:38:21 -0400 Subject: [PATCH] async open subtitle methods --- MediaBrowser.Providers/MediaInfo/SubtitleDownloader.cs | 2 +- MediaBrowser.Providers/Subtitles/OpenSubtitleDownloader.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/MediaBrowser.Providers/MediaInfo/SubtitleDownloader.cs b/MediaBrowser.Providers/MediaInfo/SubtitleDownloader.cs index 2f1c9fd535..af0f91d0b7 100644 --- a/MediaBrowser.Providers/MediaInfo/SubtitleDownloader.cs +++ b/MediaBrowser.Providers/MediaInfo/SubtitleDownloader.cs @@ -109,7 +109,7 @@ namespace MediaBrowser.Providers.MediaInfo // There's an internal subtitle stream for this language if (skipIfGraphicalSubtitlesPresent && - internalMediaStreams.Any(i => i.Type == MediaStreamType.Subtitle && string.Equals(i.Language, language, StringComparison.OrdinalIgnoreCase))) + internalMediaStreams.Any(i => i.Type == MediaStreamType.Subtitle && i.IsGraphicalSubtitleStream && string.Equals(i.Language, language, StringComparison.OrdinalIgnoreCase))) { return false; } diff --git a/MediaBrowser.Providers/Subtitles/OpenSubtitleDownloader.cs b/MediaBrowser.Providers/Subtitles/OpenSubtitleDownloader.cs index 7b40b5673a..150421272a 100644 --- a/MediaBrowser.Providers/Subtitles/OpenSubtitleDownloader.cs +++ b/MediaBrowser.Providers/Subtitles/OpenSubtitleDownloader.cs @@ -218,7 +218,8 @@ namespace MediaBrowser.Providers.Subtitles subtitleSearchParameters }; - var result = OpenSubtitles.SearchSubtitles(parms.ToArray()); + var result = await OpenSubtitles.SearchSubtitlesAsync(parms.ToArray(), cancellationToken).ConfigureAwait(false); + if (!(result is MethodResponseSubtitleSearch)) { _logger.Debug("Invalid response type");