mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-30 11:48:26 -07:00
HttpClient
This commit is contained in:
parent
3a287bf7e7
commit
2c1d3339d0
55 changed files with 995 additions and 582 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue