From 7cf2a8cb624a22ea53b79571d32b669b582b631b Mon Sep 17 00:00:00 2001 From: Devin Buhl Date: Thu, 9 Mar 2017 19:40:55 -0500 Subject: [PATCH] CP list hotfix --- .../CouchPotato/CouchPotatoParser.cs | 38 ++++++++++--------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/src/NzbDrone.Core/NetImport/CouchPotato/CouchPotatoParser.cs b/src/NzbDrone.Core/NetImport/CouchPotato/CouchPotatoParser.cs index 94ba0a27f..12a136a4f 100644 --- a/src/NzbDrone.Core/NetImport/CouchPotato/CouchPotatoParser.cs +++ b/src/NzbDrone.Core/NetImport/CouchPotato/CouchPotatoParser.cs @@ -45,31 +45,35 @@ namespace NzbDrone.Core.NetImport.CouchPotato { int tmdbid = item.info.tmdb_id ?? 0; - // if there are no releases at all the movie wasn't found on CP, so return movies - if (!item.releases.Any() && item.type == "movie") + // Fix weird error reported by Madmanali93 + if (item.type != null && item.releases != null) { - movies.AddIfNotNull(new Tv.Movie() - { - Title = item.title, - ImdbId = item.info.imdb, - TmdbId = tmdbid - }); - } - else - { - // snatched,missing,available,downloaded - // done,seeding - bool isCompleted = item.releases.Any(rel => (rel.status == "done" || rel.status == "seeding")); - if (!isCompleted) + // if there are no releases at all the movie wasn't found on CP, so return movies + if (!item.releases.Any() && item.type == "movie") { movies.AddIfNotNull(new Tv.Movie() { Title = item.title, ImdbId = item.info.imdb, - TmdbId = tmdbid, - Monitored = false + TmdbId = tmdbid }); } + else + { + // snatched,missing,available,downloaded + // done,seeding + bool isCompleted = item.releases.Any(rel => (rel.status == "done" || rel.status == "seeding")); + if (!isCompleted) + { + movies.AddIfNotNull(new Tv.Movie() + { + Title = item.title, + ImdbId = item.info.imdb, + TmdbId = tmdbid, + Monitored = false + }); + } + } } }