diff --git a/.DS_Store b/.DS_Store index e7ed6672e..8139cef01 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/src/NzbDrone.Core/MetadataSource/SkyHook/Resource/MovieResource.cs b/src/NzbDrone.Core/MetadataSource/SkyHook/Resource/MovieResource.cs new file mode 100644 index 000000000..72e3534e2 --- /dev/null +++ b/src/NzbDrone.Core/MetadataSource/SkyHook/Resource/MovieResource.cs @@ -0,0 +1,21 @@ +using System.Collections.Generic; + +namespace NzbDrone.Core.MetadataSource.SkyHook.Resource +{ + public class ImdbResource + { + public int v { get; set; } + public string q { get; set; } + public MovieResource[] d { get; set; } + } + + public class MovieResource + { + public string l { get; set; } + public string id { get; set; } + public string s { get; set; } + public int y { get; set; } + public string q { get; set; } + public object[] i { get; set; } + } +} \ No newline at end of file diff --git a/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs b/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs index 8b996fedd..97c1bb520 100644 --- a/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs +++ b/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs @@ -148,11 +148,17 @@ namespace NzbDrone.Core.MetadataSource.SkyHook var responseCleaned = response.Content.Replace(imdbCallback, "").TrimEnd(")"); - dynamic json = JsonConvert.DeserializeObject(responseCleaned); + _logger.Warn("Cleaned response: " + responseCleaned); + + ImdbResource json = JsonConvert.DeserializeObject(responseCleaned); + + _logger.Warn("Json object: " + json); + + _logger.Warn("Crash ahead."); var imdbMovies = new List(); - foreach (dynamic entry in json.d) + foreach (MovieResource entry in json.d) { var imdbMovie = new Movie(); imdbMovie.ImdbId = entry.id; @@ -166,7 +172,7 @@ namespace NzbDrone.Core.MetadataSource.SkyHook imdbMovie.Images = new List(); try { - string url = entry.i[0]; + string url = (string)entry.i[0]; var imdbPoster = new MediaCover.MediaCover(MediaCoverTypes.Poster, url); imdbMovie.Images.Add(imdbPoster); } diff --git a/src/NzbDrone.Core/NzbDrone.Core.csproj b/src/NzbDrone.Core/NzbDrone.Core.csproj index cb3dfcba2..860b3241f 100644 --- a/src/NzbDrone.Core/NzbDrone.Core.csproj +++ b/src/NzbDrone.Core/NzbDrone.Core.csproj @@ -183,6 +183,7 @@ + @@ -807,6 +808,7 @@ +