Skip to content

Commit

Permalink
Media order fix when sorting by tag count. Closes #268.
Browse files Browse the repository at this point in the history
  • Loading branch information
impworks committed Jan 12, 2024
1 parent e664524 commit 41a0ea5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Bonsai/Areas/Admin/Logic/MediaManagerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public async Task<MediaListVM> GetMediaAsync(MediaListRequestVM request)

var isDesc = request.OrderDescending ?? false;
if (request.OrderBy == nameof(Media.Tags))
query = query.OrderBy(x => x.Tags.Count, isDesc);
query = query.OrderBy(x => x.Tags.Count(y => y.Type == MediaTagType.DepictedEntity), isDesc);
else if (request.OrderBy == nameof(Media.Title))
query = query.OrderBy(x => x.Title, isDesc).ThenBy(x => x.UploadDate, isDesc);
else
Expand Down

0 comments on commit 41a0ea5

Please sign in to comment.