diff options
| author | gnattu <gnattuoc@me.com> | 2025-02-11 11:45:53 +0800 |
|---|---|---|
| committer | gnattu <gnattuoc@me.com> | 2025-02-11 11:45:53 +0800 |
| commit | d2e7ab1c1a39702dba91fe9725b0753ef172f2d7 (patch) | |
| tree | d37ae2d44fd554c55a7b8872bd61ad2042101ec8 /Jellyfin.Server.Implementations/Item | |
| parent | f12acb014a5de534d452ccbe2a72b4d8f50b797a (diff) | |
Simulate old GetItemValueNames behavior
The GetItemValueNames function in the old implementation was intended to retrieve the original value rather than the cleaned value. The old implementation lacked a clear specification regarding which value to return for the non-cleaned value in a group and relied on an undefined behavior of SQLite, and this implementation assumes the first one is the desired one.
Diffstat (limited to 'Jellyfin.Server.Implementations/Item')
| -rw-r--r-- | Jellyfin.Server.Implementations/Item/BaseItemRepository.cs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs b/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs index f9a9837f1..fa026214b 100644 --- a/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs +++ b/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs @@ -854,7 +854,10 @@ public sealed class BaseItemRepository } // query = query.DistinctBy(e => e.CleanValue); - return query.Select(e => e.ItemValue.CleanValue).ToArray(); + return query.Select(e => e.ItemValue) + .GroupBy(e => e.CleanValue) + .Select(e => e.First().Value) + .ToArray(); } private static bool TypeRequiresDeserialization(Type type) |
