added custom IntConverter to get around the mono bug

http://json.codeplex.com/workitem/24176
This commit is contained in:
Keivan Beigi
2013-09-18 17:24:50 -07:00
parent 904061c2f0
commit 41c5619d1b
15 changed files with 122 additions and 56 deletions

View File

@@ -1,12 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using NLog;
using NzbDrone.Common;
using NzbDrone.Common.Instrumentation;
using NzbDrone.Core.Messaging;
using NzbDrone.Common.Serializer;
using NzbDrone.Core.Messaging.Commands;
using NzbDrone.Core.Tv;
using NzbDrone.Core.Model.Xbmc;
@@ -63,7 +62,7 @@ namespace NzbDrone.Core.Notifications.Xbmc
var response = _httpProvider.PostCommand(settings.Address, settings.Username, settings.Password, postJson.ToString());
Logger.Trace("Getting version from response");
var result = JsonConvert.DeserializeObject<XbmcJsonResult<JObject>>(response);
var result = Json.Deserialize<XbmcJsonResult<JObject>>(response);
var versionObject = result.Result.Property("version");
@@ -71,7 +70,7 @@ namespace NzbDrone.Core.Notifications.Xbmc
return new XbmcVersion((int)versionObject.Value);
if (versionObject.Value.Type == JTokenType.Object)
return JsonConvert.DeserializeObject<XbmcVersion>(versionObject.Value.ToString());
return Json.Deserialize<XbmcVersion>(versionObject.Value.ToString());
throw new InvalidCastException("Unknown Version structure!: " + versionObject);
}