mirror of
https://github.com/Radarr/Radarr
synced 2024-12-24 17:01:38 +00:00
32 lines
No EOL
915 B
C#
32 lines
No EOL
915 B
C#
using System.Collections.Generic;
|
|
using NzbDrone.Common;
|
|
using NzbDrone.Common.Serializer;
|
|
using NzbDrone.Core.Configuration;
|
|
|
|
namespace NzbDrone.Core.DataAugmentation.Scene
|
|
{
|
|
public interface ISceneMappingProxy
|
|
{
|
|
List<SceneMapping> Fetch();
|
|
}
|
|
|
|
public class SceneMappingProxy : ISceneMappingProxy
|
|
{
|
|
private readonly IHttpProvider _httpProvider;
|
|
private readonly IConfigService _configService;
|
|
|
|
|
|
public SceneMappingProxy(IHttpProvider httpProvider, IConfigService configService)
|
|
{
|
|
_httpProvider = httpProvider;
|
|
_configService = configService;
|
|
|
|
}
|
|
|
|
public List<SceneMapping> Fetch()
|
|
{
|
|
var mappingsJson = _httpProvider.DownloadString(_configService.ServiceRootUrl + "/SceneMapping/Active");
|
|
return Json.Deserialize<List<SceneMapping>>(mappingsJson);
|
|
}
|
|
}
|
|
} |