fixed disk scan scheduler.

This commit is contained in:
kay.one 2013-05-12 19:52:55 -07:00
commit 687f8d9384
23 changed files with 140 additions and 142 deletions

View file

@ -2,15 +2,13 @@
using System.IO;
using Nancy;
using Nancy.Responses;
using NzbDrone.Common;
using NzbDrone.Common.Serializer;
namespace NzbDrone.Api.Extensions
{
public static class JsonExtensions
{
private static readonly JsonSerializer Serializer = new JsonSerializer();
private static readonly NancyJsonSerializer NancySerializer = new NancyJsonSerializer(Serializer);
private static readonly NancyJsonSerializer NancySerializer = new NancyJsonSerializer();
public static T FromJson<T>(this Stream body) where T : class, new()
{
@ -22,7 +20,7 @@ namespace NzbDrone.Api.Extensions
var reader = new StreamReader(body, true);
body.Position = 0;
var value = reader.ReadToEnd();
return (T)Serializer.Deserialize(value, type);
return (T)Json.Deserialize(value, type);
}
public static JsonResponse<TModel> AsResponse<TModel>(this TModel model, HttpStatusCode statusCode = HttpStatusCode.OK)