diff options
| author | dkanada <dkanada@users.noreply.github.com> | 2020-03-09 23:36:02 +0900 |
|---|---|---|
| committer | dkanada <dkanada@users.noreply.github.com> | 2020-03-09 23:36:02 +0900 |
| commit | d16f68bb14588ba9869a5a74e8f71dfc4af2856a (patch) | |
| tree | fb8b0cffa700c8495215aa33a8a821987f266224 /MediaBrowser.Providers/TV | |
| parent | 52fde64f103b85eb05aabe7c6fb07d7e26db6d48 (diff) | |
move omdb providers
Diffstat (limited to 'MediaBrowser.Providers/TV')
| -rw-r--r-- | MediaBrowser.Providers/TV/Omdb/OmdbEpisodeProvider.cs | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/MediaBrowser.Providers/TV/Omdb/OmdbEpisodeProvider.cs b/MediaBrowser.Providers/TV/Omdb/OmdbEpisodeProvider.cs deleted file mode 100644 index dee3030af..000000000 --- a/MediaBrowser.Providers/TV/Omdb/OmdbEpisodeProvider.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; -using MediaBrowser.Common; -using MediaBrowser.Common.Net; -using MediaBrowser.Controller.Configuration; -using MediaBrowser.Controller.Entities.TV; -using MediaBrowser.Controller.Library; -using MediaBrowser.Controller.Providers; -using MediaBrowser.Model.Entities; -using MediaBrowser.Model.IO; -using MediaBrowser.Model.Providers; -using MediaBrowser.Model.Serialization; -using MediaBrowser.Providers.Omdb; -using Microsoft.Extensions.Logging; - -namespace MediaBrowser.Providers.TV.Omdb -{ - public class OmdbEpisodeProvider : - IRemoteMetadataProvider<Episode, EpisodeInfo>, - IHasOrder - { - private readonly IJsonSerializer _jsonSerializer; - private readonly IHttpClient _httpClient; - private readonly OmdbItemProvider _itemProvider; - private readonly IFileSystem _fileSystem; - private readonly IServerConfigurationManager _configurationManager; - private readonly IApplicationHost _appHost; - - public OmdbEpisodeProvider(IJsonSerializer jsonSerializer, IApplicationHost appHost, IHttpClient httpClient, ILogger logger, ILibraryManager libraryManager, IFileSystem fileSystem, IServerConfigurationManager configurationManager) - { - _jsonSerializer = jsonSerializer; - _httpClient = httpClient; - _fileSystem = fileSystem; - _configurationManager = configurationManager; - _appHost = appHost; - _itemProvider = new OmdbItemProvider(jsonSerializer, _appHost, httpClient, logger, libraryManager, fileSystem, configurationManager); - } - - public Task<IEnumerable<RemoteSearchResult>> GetSearchResults(EpisodeInfo searchInfo, CancellationToken cancellationToken) - { - return _itemProvider.GetSearchResults(searchInfo, "episode", cancellationToken); - } - - public async Task<MetadataResult<Episode>> GetMetadata(EpisodeInfo info, CancellationToken cancellationToken) - { - var result = new MetadataResult<Episode>() - { - Item = new Episode(), - QueriedById = true - }; - - // Allowing this will dramatically increase scan times - if (info.IsMissingEpisode) - { - return result; - } - - if (info.SeriesProviderIds.TryGetValue(MetadataProviders.Imdb.ToString(), out string seriesImdbId) && !string.IsNullOrEmpty(seriesImdbId)) - { - if (info.IndexNumber.HasValue && info.ParentIndexNumber.HasValue) - { - result.HasMetadata = await new OmdbProvider(_jsonSerializer, _httpClient, _fileSystem, _appHost, _configurationManager) - .FetchEpisodeData(result, info.IndexNumber.Value, info.ParentIndexNumber.Value, info.GetProviderId(MetadataProviders.Imdb), seriesImdbId, info.MetadataLanguage, info.MetadataCountryCode, cancellationToken).ConfigureAwait(false); - } - } - - return result; - } - // After TheTvDb - public int Order => 1; - - public string Name => "The Open Movie Database"; - - public Task<HttpResponseInfo> GetImageResponse(string url, CancellationToken cancellationToken) - { - return _itemProvider.GetImageResponse(url, cancellationToken); - } - } -} |
