Sonarr/NzbDrone.Core/DataAugmentation/Scene/SceneMappingProxy.cs

27 lines
711 B
C#
Raw Normal View History

2013-04-01 02:43:58 +00:00
using System.Collections.Generic;
using NzbDrone.Common;
2013-05-12 15:18:17 +00:00
using NzbDrone.Common.Serializer;
2013-04-01 02:43:58 +00:00
namespace NzbDrone.Core.DataAugmentation.Scene
{
public interface ISceneMappingProxy
{
List<SceneMapping> Fetch();
}
public class SceneMappingProxy : ISceneMappingProxy
{
2013-04-10 23:41:45 +00:00
private readonly IHttpProvider _httpProvider;
2013-04-01 02:43:58 +00:00
2013-08-24 02:21:12 +00:00
public SceneMappingProxy(IHttpProvider httpProvider)
2013-04-01 02:43:58 +00:00
{
_httpProvider = httpProvider;
}
public List<SceneMapping> Fetch()
{
2013-09-06 06:25:34 +00:00
var mappingsJson = _httpProvider.DownloadString(Services.RootUrl + "/v1/SceneMapping");
2013-05-13 02:52:55 +00:00
return Json.Deserialize<List<SceneMapping>>(mappingsJson);
2013-04-01 02:43:58 +00:00
}
}
}