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