Fixed: Refresh Deleted & Upcoming shows as frequently as Continuing ones
This commit is contained in:
parent
70a40edc5d
commit
06d57e8f32
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue