Report size is now verified to ensure it is under the MaxSize for that quality type, with tests.

This commit is contained in:
Mark McDowall 2011-09-13 21:37:22 -07:00
commit 4b2427ade7
7 changed files with 479 additions and 3 deletions

View file

@ -330,6 +330,21 @@ namespace NzbDrone.Core.Providers
Logger.Info("Ignore flag for Episode:{0} successfully set to {1}", episodeId, isIgnored);
}
public virtual bool IsFirstOrLastEpisodeOfSeason(int seriesId, int seasonNumber, int episodeNumber)
{
var episodes = GetEpisodesBySeason(seriesId, seasonNumber).OrderBy(e => e.EpisodeNumber);
if (episodes.Count() == 0)
return false;
//Ensure that this is either the first episode
//or is the last episode in a season that has 10 or more episodes
if (episodes.First().EpisodeNumber == episodeNumber || (episodes.Count() >= 10 && episodes.Last().EpisodeNumber == episodeNumber))
return true;
return false;
}
public IList<Episode> AttachSeries(IList<Episode> episodes)
{
if (episodes.Count == 0) return episodes;