mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-22 22:14:44 -04:00
HttpClient
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using NzbDrone.Common;
|
||||
using NzbDrone.Common.Cloud;
|
||||
using NzbDrone.Common.Http;
|
||||
using NzbDrone.Common.Serializer;
|
||||
|
||||
namespace NzbDrone.Core.DataAugmentation.Scene
|
||||
{
|
||||
@@ -12,17 +11,19 @@ namespace NzbDrone.Core.DataAugmentation.Scene
|
||||
|
||||
public class SceneMappingProxy : ISceneMappingProxy
|
||||
{
|
||||
private readonly IHttpProvider _httpProvider;
|
||||
private readonly IHttpClient _httpClient;
|
||||
private readonly IDroneServicesRequestBuilder _requestBuilder;
|
||||
|
||||
public SceneMappingProxy(IHttpProvider httpProvider)
|
||||
public SceneMappingProxy(IHttpClient httpClient, IDroneServicesRequestBuilder requestBuilder)
|
||||
{
|
||||
_httpProvider = httpProvider;
|
||||
_httpClient = httpClient;
|
||||
_requestBuilder = requestBuilder;
|
||||
}
|
||||
|
||||
public List<SceneMapping> Fetch()
|
||||
{
|
||||
var mappingsJson = _httpProvider.DownloadString(Services.RootUrl + "/v1/SceneMapping");
|
||||
return Json.Deserialize<List<SceneMapping>>(mappingsJson);
|
||||
var request = _requestBuilder.Build("/scenemapping");
|
||||
return _httpClient.Get<List<SceneMapping>>(request).Resource;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user