Skip to content

Commit

Permalink
Get the groupby sort orders right
Browse files Browse the repository at this point in the history
  • Loading branch information
Webreaper committed May 11, 2021
1 parent 21dca79 commit 6535621
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 @@ -171,9 +171,9 @@
var result = gridImages.GroupBy(x => x.Folder);

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

return result.Select(x => new ImageGrouping { Key = x.Key.Path, Images = x.ToList() })
.ToList();
Expand All @@ -183,9 +183,9 @@
var result = gridImages.GroupBy(x => x.SortDate.Date);

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

return result.Select(x => new ImageGrouping { Key = x.Key.ToString("dddd, dd MMMM yyyy"), Images = x.ToList() })
.ToList();
Expand Down

0 comments on commit 6535621

Please sign in to comment.