diff --git a/NzbDrone.Core/Providers/MediaFileProvider.cs b/NzbDrone.Core/Providers/MediaFileProvider.cs index 7a6bbf762..325fdfc2b 100644 --- a/NzbDrone.Core/Providers/MediaFileProvider.cs +++ b/NzbDrone.Core/Providers/MediaFileProvider.cs @@ -205,12 +205,12 @@ public virtual IEnumerable GetSeriesFiles(int seriesId) public virtual Tuple 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(avilableEpisodes.Count(), episodeTotal.Count()); + return new Tuple(avilableEpisodes.Count, episodeTotal.Count); } private List GetMediaFileList(string path)