This commit is contained in:
tidusjar 2016-04-06 23:08:00 +01:00
commit 3efd54c1b6
7 changed files with 57 additions and 15 deletions

View file

@ -25,6 +25,7 @@
// ************************************************************************/
#endregion
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
@ -33,13 +34,19 @@ using Newtonsoft.Json;
using NLog;
using PlexRequests.Api.Interfaces;
using PlexRequests.Helpers;
using RestSharp;
namespace PlexRequests.Api
{
public class ApiRequest : IApiRequest
{
private JsonSerializerSettings Settings = new JsonSerializerSettings
{
NullValueHandling = NullValueHandling.Ignore,
MissingMemberHandling = MissingMemberHandling.Ignore
};
private static Logger Log = LogManager.GetCurrentClassLogger();
/// <summary>
/// An API request handler
@ -108,7 +115,7 @@ namespace PlexRequests.Api
}
var json = JsonConvert.DeserializeObject<T>(response.Content);
var json = JsonConvert.DeserializeObject<T>(response.Content, Settings);
return json;
}
@ -129,4 +136,6 @@ namespace PlexRequests.Api
}
}
}
}

View file

@ -84,7 +84,7 @@ namespace PlexRequests.Api
while (seasonIncrement < seasonCount)
{
seasonList = VerifyShowHasLoaded(tvdbId, apiKey, baseUrl);
seasonIncrement = seasonList.data?.Length ?? 0;
seasonIncrement = seasonList.Data?.Length ?? 0;
if (sw.ElapsedMilliseconds > 30000) // Break out after 30 seconds, it's not going to get added
{