CP list hotfix

pull/1106/head
Devin Buhl 8 years ago
parent 1a4fb6e7bb
commit 7cf2a8cb62

@ -45,31 +45,35 @@ namespace NzbDrone.Core.NetImport.CouchPotato
{ {
int tmdbid = item.info.tmdb_id ?? 0; int tmdbid = item.info.tmdb_id ?? 0;
// if there are no releases at all the movie wasn't found on CP, so return movies // Fix weird error reported by Madmanali93
if (!item.releases.Any() && item.type == "movie") if (item.type != null && item.releases != null)
{ {
movies.AddIfNotNull(new Tv.Movie() // if there are no releases at all the movie wasn't found on CP, so return movies
{ if (!item.releases.Any() && item.type == "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)
{ {
movies.AddIfNotNull(new Tv.Movie() movies.AddIfNotNull(new Tv.Movie()
{ {
Title = item.title, Title = item.title,
ImdbId = item.info.imdb, ImdbId = item.info.imdb,
TmdbId = tmdbid, TmdbId = tmdbid
Monitored = false
}); });
} }
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
});
}
}
} }
} }

Loading…
Cancel
Save