1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2025-01-30 19:31:35 +00:00

SeasonProvider GetLatestSeason added

This commit is contained in:
markus101 2011-02-09 22:41:24 -08:00
parent 57f5b3ddc2
commit ac20da426b
2 changed files with 6 additions and 0 deletions

View file

@ -7,6 +7,7 @@ public interface ISeasonProvider
{
Season GetSeason(int seasonId);
List<Season> GetSeasons(int seriesId);
Season GetLatestSeason(int seriesId);
void EnsureSeason(int seriesId, int seasonId, int seasonNumber);
int SaveSeason(Season season);
bool IsIgnored(int seasonId);

View file

@ -27,6 +27,11 @@ public List<Season> GetSeasons(int seriesId)
return _sonicRepo.All<Season>().Where(s => s.SeriesId == seriesId).ToList();
}
public Season GetLatestSeason(int seriesId)
{
return _sonicRepo.All<Season>().Where(s => s.SeriesId == seriesId).OrderBy(s => s.SeasonNumber).Last();
}
public void EnsureSeason(int seriesId, int seasonId, int seasonNumber)
{
if (_sonicRepo.Exists<Season>(s => s.SeasonId == seasonId))