1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2025-03-05 15:15:59 +02:00

28 lines
750 B
C#
Raw Normal View History

2013-03-31 19:43:58 -07:00
using System.Collections.Generic;
using NzbDrone.Common;
2013-05-12 08:18:17 -07:00
using NzbDrone.Common.Serializer;
2013-03-31 19:43:58 -07:00
using NzbDrone.Core.Configuration;
namespace NzbDrone.Core.DataAugmentation.Scene
{
public interface ISceneMappingProxy
{
List<SceneMapping> Fetch();
}
public class SceneMappingProxy : ISceneMappingProxy
{
2013-04-10 16:41:45 -07:00
private readonly IHttpProvider _httpProvider;
2013-03-31 19:43:58 -07:00
2013-08-23 19:21:12 -07:00
public SceneMappingProxy(IHttpProvider httpProvider)
2013-03-31 19:43:58 -07:00
{
_httpProvider = httpProvider;
}
public List<SceneMapping> Fetch()
{
2013-08-23 19:21:12 -07:00
var mappingsJson = _httpProvider.DownloadString(Services.RootUrl + "/SceneMapping/Active");
2013-05-12 19:52:55 -07:00
return Json.Deserialize<List<SceneMapping>>(mappingsJson);
2013-03-31 19:43:58 -07:00
}
}
}