Fixed: Refresh Deleted & Upcoming shows as frequently as Continuing ones

This commit is contained in:
Taloth Saldono 2019-11-24 23:47:22 +01:00
parent 70a40edc5d
commit 06d57e8f32
2 changed files with 30 additions and 2 deletions

View File

@ -34,6 +34,16 @@ namespace NzbDrone.Core.Test.TvTests
_series.Status = SeriesStatusType.Ended;
}
private void GivenSeriesIsDeleted()
{
_series.Status = SeriesStatusType.Deleted;
}
private void GivenSeriesIsUpcoming()
{
_series.Status = SeriesStatusType.Upcoming;
}
private void GivenSeriesLastRefreshedMonthsAgo()
{
_series.LastInfoSync = DateTime.UtcNow.AddDays(-90);
@ -131,5 +141,23 @@ namespace NzbDrone.Core.Test.TvTests
Subject.ShouldRefresh(_series).Should().BeFalse();
}
[Test]
public void should_return_true_if_deleted_series_last_refreshed_more_than_6_hours_ago()
{
GivenSeriesLastRefreshedHalfADayAgo();
GivenSeriesIsDeleted();
Subject.ShouldRefresh(_series).Should().BeTrue();
}
[Test]
public void should_return_true_if_upcoming_series_last_refreshed_more_than_6_hours_ago()
{
GivenSeriesLastRefreshedHalfADayAgo();
GivenSeriesIsUpcoming();
Subject.ShouldRefresh(_series).Should().BeTrue();
}
}
}

View File

@ -34,9 +34,9 @@ namespace NzbDrone.Core.Tv
return false;
}
if (series.Status == SeriesStatusType.Continuing)
if (series.Status != SeriesStatusType.Ended)
{
_logger.Trace("Series {0} is continuing, should refresh.", series.Title);
_logger.Trace("Series {0} is not ended, should refresh.", series.Title);
return true;
}