Fixed: Older movies (released more than 30 days ago) are now not refreshed as often anymore (every 30 days)

pull/1870/head
Leonardo Galli 7 years ago
parent 67dd498576
commit b06108fb45

@ -109,6 +109,11 @@ namespace NzbDrone.Core.Tv
return DateTime.Now >= MinimumAvailabilityDate.AddDays((double)delay); return DateTime.Now >= MinimumAvailabilityDate.AddDays((double)delay);
} }
public DateTime PhysicalReleaseDate()
{
return PhysicalRelease ?? (InCinemas?.AddDays(90) ?? DateTime.MaxValue);
}
public override string ToString() public override string ToString()
{ {
return string.Format("[{0}][{1} ({2})]", ImdbId, Title.NullSafe(), Year.NullSafe()); return string.Format("[{0}][{1} ({2})]", ImdbId, Title.NullSafe(), Year.NullSafe());

@ -34,13 +34,19 @@ namespace NzbDrone.Core.Tv
return false; return false;
} }
if (movie.Status != MovieStatusType.TBA) if (movie.Status == MovieStatusType.Announced || movie.Status == MovieStatusType.InCinemas)
{ {
_logger.Trace("Movie {0} is announced or released, should refresh.", movie.Title); //We probably have to change this. _logger.Trace("Movie {0} is announced or in cinemas, should refresh.", movie.Title); //We probably have to change this.
return true; return true;
} }
_logger.Trace("Movie {0} ended long ago, should not be refreshed.", movie.Title); if (movie.Status == MovieStatusType.Released && movie.PhysicalReleaseDate() >= DateTime.UtcNow.AddDays(-30))
{
_logger.Trace("Movie {0} is released since less than 30 days, should refresh", movie.Title);
return true;
}
_logger.Trace("Movie {0} came out long ago, should not be refreshed.", movie.Title);
return false; return false;
} }
} }

Loading…
Cancel
Save