浏览代码

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.
gnattu 3 月之前
父节点
当前提交
d2e7ab1c1a
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      Jellyfin.Server.Implementations/Item/BaseItemRepository.cs

+ 4 - 1
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)