1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00

Rename previews are now ordered in asscending season and epsiode order

This commit is contained in:
Mark McDowall 2013-11-29 17:26:13 -08:00
parent c554e3f6b9
commit 3266d05c82

View File

@ -54,7 +54,10 @@ public List<RenameEpisodeFilePreview> GetRenamePreviews(int seriesId)
var episodes = _episodeService.GetEpisodeBySeries(seriesId);
var files = _mediaFileService.GetFilesBySeries(seriesId);
return GetPreviews(series, episodes, files).ToList();
return GetPreviews(series, episodes, files)
.OrderBy(e => e.SeasonNumber)
.ThenBy(e => e.EpisodeNumbers.First())
.ToList();
}
public List<RenameEpisodeFilePreview> GetRenamePreviews(int seriesId, int seasonNumber)
@ -63,7 +66,8 @@ public List<RenameEpisodeFilePreview> GetRenamePreviews(int seriesId, int season
var episodes = _episodeService.GetEpisodesBySeason(seriesId, seasonNumber);
var files = _mediaFileService.GetFilesBySeason(seriesId, seasonNumber);
return GetPreviews(series, episodes, files).ToList();
return GetPreviews(series, episodes, files)
.OrderBy(e => e.EpisodeNumbers.First()).ToList();
}
private IEnumerable<RenameEpisodeFilePreview> GetPreviews(Series series, List<Episode> episodes, List<EpisodeFile> files)