diff options
Diffstat (limited to 'MediaBrowser.Providers/Plugins/AudioDb/ArtistImageProvider.cs')
| -rw-r--r-- | MediaBrowser.Providers/Plugins/AudioDb/ArtistImageProvider.cs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/MediaBrowser.Providers/Plugins/AudioDb/ArtistImageProvider.cs b/MediaBrowser.Providers/Plugins/AudioDb/ArtistImageProvider.cs index 18afd5dd5..54851c4d0 100644 --- a/MediaBrowser.Providers/Plugins/AudioDb/ArtistImageProvider.cs +++ b/MediaBrowser.Providers/Plugins/AudioDb/ArtistImageProvider.cs @@ -1,4 +1,7 @@ +#pragma warning disable CS1591 + using System.Collections.Generic; +using System.Net.Http; using System.Threading; using System.Threading.Tasks; using MediaBrowser.Common.Net; @@ -15,14 +18,14 @@ namespace MediaBrowser.Providers.Plugins.AudioDb public class AudioDbArtistImageProvider : IRemoteImageProvider, IHasOrder { private readonly IServerConfigurationManager _config; - private readonly IHttpClient _httpClient; + private readonly IHttpClientFactory _httpClientFactory; private readonly IJsonSerializer _json; - public AudioDbArtistImageProvider(IServerConfigurationManager config, IJsonSerializer json, IHttpClient httpClient) + public AudioDbArtistImageProvider(IServerConfigurationManager config, IJsonSerializer json, IHttpClientFactory httpClientFactory) { _config = config; _json = json; - _httpClient = httpClient; + _httpClientFactory = httpClientFactory; } /// <inheritdoc /> @@ -47,7 +50,7 @@ namespace MediaBrowser.Providers.Plugins.AudioDb /// <inheritdoc /> public async Task<IEnumerable<RemoteImageInfo>> GetImages(BaseItem item, CancellationToken cancellationToken) { - var id = item.GetProviderId(MetadataProviders.MusicBrainzArtist); + var id = item.GetProviderId(MetadataProvider.MusicBrainzArtist); if (!string.IsNullOrWhiteSpace(id)) { @@ -133,13 +136,10 @@ namespace MediaBrowser.Providers.Plugins.AudioDb return list; } - public Task<HttpResponseInfo> GetImageResponse(string url, CancellationToken cancellationToken) + public Task<HttpResponseMessage> GetImageResponse(string url, CancellationToken cancellationToken) { - return _httpClient.GetResponse(new HttpRequestOptions - { - CancellationToken = cancellationToken, - Url = url - }); + var httpClient = _httpClientFactory.CreateClient(NamedClient.Default); + return httpClient.GetAsync(url, cancellationToken); } /// <inheritdoc /> |
