1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-20 18:02:44 +01:00

Switch Trakt to STJson

Fixes #7913
This commit is contained in:
Qstick 2023-01-08 21:11:59 -06:00
parent d1080b825c
commit 09642444d7
2 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using Newtonsoft.Json;
using NzbDrone.Common.Extensions; using NzbDrone.Common.Extensions;
using NzbDrone.Common.Serializer;
using NzbDrone.Core.ImportLists.ImportListMovies; using NzbDrone.Core.ImportLists.ImportListMovies;
using NzbDrone.Core.Notifications.Trakt.Resource; using NzbDrone.Core.Notifications.Trakt.Resource;
@ -31,11 +31,11 @@ public override IList<ImportListMovie> ParseResponse(ImportListResponse importRe
if (_settings.TraktListType == (int)TraktPopularListType.Popular) if (_settings.TraktListType == (int)TraktPopularListType.Popular)
{ {
jsonResponse = JsonConvert.DeserializeObject<List<TraktMovieResource>>(_importResponse.Content); jsonResponse = STJson.Deserialize<List<TraktMovieResource>>(_importResponse.Content);
} }
else else
{ {
jsonResponse = JsonConvert.DeserializeObject<List<TraktListResource>>(_importResponse.Content).SelectList(c => c.Movie); jsonResponse = STJson.Deserialize<List<TraktListResource>>(_importResponse.Content).SelectList(c => c.Movie);
} }
// no movies were return // no movies were return

View File

@ -1,7 +1,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Net; using System.Net;
using Newtonsoft.Json;
using NzbDrone.Common.Extensions; using NzbDrone.Common.Extensions;
using NzbDrone.Common.Serializer;
using NzbDrone.Core.ImportLists.Exceptions; using NzbDrone.Core.ImportLists.Exceptions;
using NzbDrone.Core.ImportLists.ImportListMovies; using NzbDrone.Core.ImportLists.ImportListMovies;
using NzbDrone.Core.Notifications.Trakt.Resource; using NzbDrone.Core.Notifications.Trakt.Resource;
@ -27,7 +27,7 @@ public virtual IList<ImportListMovie> ParseResponse(ImportListResponse importRes
return movies; return movies;
} }
var jsonResponse = JsonConvert.DeserializeObject<List<TraktListResource>>(_importResponse.Content); var jsonResponse = STJson.Deserialize<List<TraktListResource>>(_importResponse.Content);
// no movies were return // no movies were return
if (jsonResponse == null) if (jsonResponse == null)