1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-26 01:38:24 +00:00

Fixed: Consider Released if we have a digital release

Fixes #4460
This commit is contained in:
Qstick 2020-05-25 00:14:41 -04:00
parent b997bf21a5
commit f00f4d0c2c

View file

@ -14,7 +14,6 @@
using NzbDrone.Core.Movies;
using NzbDrone.Core.Movies.AlternativeTitles;
using NzbDrone.Core.Movies.Credits;
using NzbDrone.Core.NetImport.ImportExclusions;
using NzbDrone.Core.NetImport.TMDb;
using NzbDrone.Core.Parser;
@ -170,31 +169,31 @@ public Movie MapMovie(MovieResource resource)
var now = DateTime.Now;
//handle the case when we have both theatrical and physical release dates
if (movie.InCinemas.HasValue && movie.PhysicalRelease.HasValue)
if (resource.InCinema.HasValue && resource.PhysicalRelease.HasValue)
{
if (now < movie.InCinemas)
if (now < resource.InCinema)
{
movie.Status = MovieStatusType.Announced;
}
else if (now >= movie.InCinemas)
else if (now >= resource.InCinema)
{
movie.Status = MovieStatusType.InCinemas;
}
if (now >= movie.PhysicalRelease)
if (now >= resource.PhysicalRelease)
{
movie.Status = MovieStatusType.Released;
}
}
//handle the case when we have theatrical release dates but we dont know the physical release date
else if (movie.InCinemas.HasValue && (now >= movie.InCinemas))
else if (resource.InCinema.HasValue && (now >= resource.InCinema))
{
movie.Status = MovieStatusType.InCinemas;
}
//handle the case where we only have a physical release date
else if (movie.PhysicalRelease.HasValue && (now >= movie.PhysicalRelease))
else if ((resource.PhysicalRelease.HasValue && (now >= resource.PhysicalRelease)) || (resource.DigitalRelease.HasValue && (now >= resource.DigitalRelease)))
{
movie.Status = MovieStatusType.Released;
}