mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 05:47:14 -04:00
Cleanup in TmdbMovieProvider
This commit is contained in:
parent
e9524f89d6
commit
08e1f15add
@ -4,9 +4,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Net.Http.Headers;
|
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using MediaBrowser.Common.Net;
|
using MediaBrowser.Common.Net;
|
||||||
@ -16,7 +14,6 @@ using MediaBrowser.Controller.Library;
|
|||||||
using MediaBrowser.Controller.Providers;
|
using MediaBrowser.Controller.Providers;
|
||||||
using MediaBrowser.Model.Entities;
|
using MediaBrowser.Model.Entities;
|
||||||
using MediaBrowser.Model.Providers;
|
using MediaBrowser.Model.Providers;
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
|
|
||||||
namespace MediaBrowser.Providers.Plugins.Tmdb.Movies
|
namespace MediaBrowser.Providers.Plugins.Tmdb.Movies
|
||||||
{
|
{
|
||||||
@ -26,30 +23,24 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.Movies
|
|||||||
public class TmdbMovieProvider : IRemoteMetadataProvider<Movie, MovieInfo>, IHasOrder
|
public class TmdbMovieProvider : IRemoteMetadataProvider<Movie, MovieInfo>, IHasOrder
|
||||||
{
|
{
|
||||||
private readonly IHttpClientFactory _httpClientFactory;
|
private readonly IHttpClientFactory _httpClientFactory;
|
||||||
private readonly ILogger<TmdbMovieProvider> _logger;
|
|
||||||
private readonly ILibraryManager _libraryManager;
|
private readonly ILibraryManager _libraryManager;
|
||||||
private readonly TmdbClientManager _tmdbClientManager;
|
private readonly TmdbClientManager _tmdbClientManager;
|
||||||
|
|
||||||
|
public TmdbMovieProvider(
|
||||||
|
ILibraryManager libraryManager,
|
||||||
|
TmdbClientManager tmdbClientManager,
|
||||||
|
IHttpClientFactory httpClientFactory)
|
||||||
|
{
|
||||||
|
_libraryManager = libraryManager;
|
||||||
|
_tmdbClientManager = tmdbClientManager;
|
||||||
|
_httpClientFactory = httpClientFactory;
|
||||||
|
}
|
||||||
|
|
||||||
public string Name => TmdbUtils.ProviderName;
|
public string Name => TmdbUtils.ProviderName;
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public int Order => 1;
|
public int Order => 1;
|
||||||
|
|
||||||
internal static TmdbMovieProvider Current { get; private set; }
|
|
||||||
|
|
||||||
public TmdbMovieProvider(
|
|
||||||
ILogger<TmdbMovieProvider> logger,
|
|
||||||
ILibraryManager libraryManager,
|
|
||||||
TmdbClientManager tmdbClientManager,
|
|
||||||
IHttpClientFactory httpClientFactory)
|
|
||||||
{
|
|
||||||
_logger = logger;
|
|
||||||
_libraryManager = libraryManager;
|
|
||||||
_tmdbClientManager = tmdbClientManager;
|
|
||||||
_httpClientFactory = httpClientFactory;
|
|
||||||
Current = this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<IEnumerable<RemoteSearchResult>> GetSearchResults(MovieInfo searchInfo, CancellationToken cancellationToken)
|
public async Task<IEnumerable<RemoteSearchResult>> GetSearchResults(MovieInfo searchInfo, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var tmdbId = Convert.ToInt32(searchInfo.GetProviderId(MetadataProvider.Tmdb), CultureInfo.InvariantCulture);
|
var tmdbId = Convert.ToInt32(searchInfo.GetProviderId(MetadataProvider.Tmdb), CultureInfo.InvariantCulture);
|
||||||
|
Loading…
Reference in New Issue
Block a user