mirror of
https://github.com/lidarr/Lidarr
synced 2024-12-25 17:17:02 +00:00
Using .ToList() to get around IEnumerable multi-DB calls and possible SubSonic bug with IQueryable.
This commit is contained in:
parent
c8ae3de292
commit
1fbf9a1416
1 changed files with 4 additions and 4 deletions
|
@ -205,12 +205,12 @@ public virtual IEnumerable<EpisodeFile> GetSeriesFiles(int seriesId)
|
|||
|
||||
public virtual Tuple<int, int> GetEpisodeFilesCount(int seriesId)
|
||||
{
|
||||
var allEpisodes = _episodeProvider.GetEpisodeBySeries(seriesId);
|
||||
var allEpisodes = _episodeProvider.GetEpisodeBySeries(seriesId).ToList();
|
||||
|
||||
var episodeTotal = allEpisodes.Where(e => !e.Ignored && e.AirDate <= DateTime.Today && e.AirDate.Year > 1900);
|
||||
var avilableEpisodes = episodeTotal.Where(e => e.EpisodeFileId > 0);
|
||||
var episodeTotal = allEpisodes.Where(e => !e.Ignored && e.AirDate <= DateTime.Today && e.AirDate.Year > 1900).ToList();
|
||||
var avilableEpisodes = episodeTotal.Where(e => e.EpisodeFileId > 0).ToList();
|
||||
|
||||
return new Tuple<int, int>(avilableEpisodes.Count(), episodeTotal.Count());
|
||||
return new Tuple<int, int>(avilableEpisodes.Count, episodeTotal.Count);
|
||||
}
|
||||
|
||||
private List<string> GetMediaFileList(string path)
|
||||
|
|
Loading…
Reference in a new issue