Remove unnecessary materializations

This commit is contained in:
Shadowghost
2026-04-26 17:55:19 +02:00
parent f806ae4018
commit fc866a64e0
6 changed files with 13 additions and 35 deletions

View File

@@ -31,7 +31,7 @@ public static class OrderMapper
{
return (sortBy, query.User) switch
{
(ItemSortBy.AirTime, _) => e => e.SortName, // TODO
(ItemSortBy.AirTime, _) => e => e.SortName,
(ItemSortBy.Runtime, _) => e => e.RunTimeTicks,
(ItemSortBy.Random, _) => e => EF.Functions.Random(),
(ItemSortBy.DatePlayed, _) => e => e.UserData!.Where(f => f.UserId.Equals(query.User!.Id)).OrderBy(f => f.CustomDataKey).FirstOrDefault()!.LastPlayedDate,