You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
943 B
32 lines
943 B
using System.Collections.Generic;
|
|
using NzbDrone.Common.Cloud;
|
|
using NzbDrone.Common.Http;
|
|
|
|
namespace NzbDrone.Core.DataAugmentation.Scene
|
|
{
|
|
public interface ISceneMappingProxy
|
|
{
|
|
List<SceneMapping> Fetch();
|
|
}
|
|
|
|
public class SceneMappingProxy : ISceneMappingProxy
|
|
{
|
|
private readonly IHttpClient _httpClient;
|
|
private readonly IHttpRequestBuilderFactory _requestBuilder;
|
|
|
|
public SceneMappingProxy(IHttpClient httpClient, ILidarrCloudRequestBuilder requestBuilder)
|
|
{
|
|
_httpClient = httpClient;
|
|
_requestBuilder = requestBuilder.Services;
|
|
}
|
|
|
|
public List<SceneMapping> Fetch()
|
|
{
|
|
var request = _requestBuilder.Create()
|
|
.Resource("/scenemapping")
|
|
.Build();
|
|
|
|
return _httpClient.Get<List<SceneMapping>>(request).Resource;
|
|
}
|
|
}
|
|
} |