json serializer updates.

This commit is contained in:
Keivan Beigi 2013-04-17 16:32:06 -07:00
commit f9bb4178ed
13 changed files with 46 additions and 37 deletions

View file

@ -1,5 +1,4 @@
using System.Collections.Generic;
using Newtonsoft.Json;
using NzbDrone.Common;
using NzbDrone.Core.Configuration;
@ -14,17 +13,19 @@ namespace NzbDrone.Core.DataAugmentation.Scene
{
private readonly IHttpProvider _httpProvider;
private readonly IConfigService _configService;
private readonly IJsonSerializer _jsonSerializer;
public SceneMappingProxy(IHttpProvider httpProvider, IConfigService configService)
public SceneMappingProxy(IHttpProvider httpProvider, IConfigService configService, IJsonSerializer jsonSerializer)
{
_httpProvider = httpProvider;
_configService = configService;
_jsonSerializer = jsonSerializer;
}
public List<SceneMapping> Fetch()
{
var mappingsJson = _httpProvider.DownloadString(_configService.ServiceRootUrl + "/SceneMapping/Active");
return JsonConvert.DeserializeObject<List<SceneMapping>>(mappingsJson);
return _jsonSerializer.Deserialize<List<SceneMapping>>(mappingsJson);
}
}
}