Rename series added

This commit is contained in:
Mark McDowall 2013-07-18 22:23:04 -07:00
commit 637b101975
13 changed files with 233 additions and 19 deletions

View file

@ -9,6 +9,7 @@ namespace NzbDrone.Core.MediaFiles
{
EpisodeFile GetFileByPath(string path);
List<EpisodeFile> GetFilesBySeries(int seriesId);
List<EpisodeFile> GetFilesBySeason(int seriesId, int seasonNumber);
bool Exists(string path);
}
@ -20,21 +21,26 @@ namespace NzbDrone.Core.MediaFiles
{
}
public EpisodeFile GetFileByPath(string path)
{
return Query.SingleOrDefault(c => c.Path == path);
}
public bool Exists(string path)
{
return Query.Any(c => c.Path == path);
}
public List<EpisodeFile> GetFilesBySeries(int seriesId)
{
return Query.Where(c => c.SeriesId == seriesId).ToList();
}
public List<EpisodeFile> GetFilesBySeason(int seriesId, int seasonNumber)
{
return Query.Where(c => c.SeriesId == seriesId)
.AndWhere(c => c.SeasonNumber == seasonNumber)
.ToList();
}
public bool Exists(string path)
{
return Query.Any(c => c.Path == path);
}
}
}