Skip to content

Commit

Permalink
misc: order file list by series id.
Browse files Browse the repository at this point in the history
  • Loading branch information
revam committed Apr 12, 2024
1 parent fcd4017 commit 9de4aa6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Shokofin/Resolvers/ShokoResolveManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -938,9 +938,9 @@ private async Task<bool> ShouldFilterFile(string partialPath, string fullPath, b
// return new() { Items = items, ExtraFiles = new() };

// TODO: Remove these two hacks once we have proper support for adding multiple series at once.
if (items.Where(i => i is Movie).ToList().Count == 0 && items.Count > 0) {
if (!items.Any(i => i is Movie) && items.Count > 0) {
fileInfoList.Clear();
fileInfoList.AddRange(items.Select(s => FileSystem.GetFileSystemInfo(s.Path)));
fileInfoList.AddRange(items.OrderBy(s => int.Parse(s.Path.GetAttributeValue(ShokoSeriesId.Name)!)).Select(s => FileSystem.GetFileSystemInfo(s.Path)));
}

return new() { Items = items.Where(i => i is Movie).ToList(), ExtraFiles = items.OfType<TvSeries>().Select(s => FileSystem.GetFileSystemInfo(s.Path)).ToList() };
Expand Down

0 comments on commit 9de4aa6

Please sign in to comment.