1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-04 10:02:40 +01:00

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

This commit is contained in:
Leonardo Galli 2017-07-28 16:59:06 +02:00
parent 67dd498576
commit b06108fb45
2 changed files with 14 additions and 3 deletions

View File

@ -109,6 +109,11 @@ public bool IsAvailable(int delay = 0)
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());

View File

@ -34,13 +34,19 @@ public bool ShouldRefresh(Movie movie)
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;
} }
} }