Skip to content

Commit

Permalink
Fix grouping
Browse files Browse the repository at this point in the history
  • Loading branch information
Webreaper committed Sep 30, 2021
1 parent 0dbe81b commit 0a7c2c1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Damselfly.Web/Shared/Images/ImageGrid.razor
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,14 @@
// TODO: Order by
if (searchService.Grouping == SearchQuery.GroupingType.Folder)
{
var result = gridImages.GroupBy(x => x.Folder);
var result = gridImages.GroupBy(x => x.Folder.Path);

if (searchService.SortOrder == SearchQuery.SortOrderType.Descending)
result = result.OrderByDescending(x => x.Key.Path);
result = result.OrderByDescending(x => x.Key);
else
result = result.OrderBy(x => x.Key.Path);
result = result.OrderBy(x => x.Key);

return result.Select(x => new ImageGrouping { Key = x.Key.Path, Images = x.ToList() })
return result.Select(x => new ImageGrouping { Key = x.Key, Images = x.ToList() })
.ToList();
}
else if (searchService.Grouping == SearchQuery.GroupingType.Date)
Expand Down

0 comments on commit 0a7c2c1

Please sign in to comment.