1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-16 07:52:36 +01:00
Radarr/NzbDrone.Core/DataAugmentation/Scene/SceneMappingProxy.cs
2013-08-23 21:45:01 -07:00

28 lines
750 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;
public SceneMappingProxy(IHttpProvider httpProvider)
{
_httpProvider = httpProvider;
}
public List<SceneMapping> Fetch()
{
var mappingsJson = _httpProvider.DownloadString(Services.RootUrl + "/SceneMapping/Active");
return Json.Deserialize<List<SceneMapping>>(mappingsJson);
}
}
}