mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-16 05:53:03 +03:00
Filter duplicate BaseItems on save
This commit is contained in:
@@ -358,10 +358,9 @@ public sealed class BaseItemRepository(
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
var itemsLen = items.Count;
|
||||
var tuples = new (BaseItemDto Item, List<Guid>? AncestorIds, BaseItemDto TopParent, IEnumerable<string> UserDataKey, List<string> InheritedTags)[itemsLen];
|
||||
for (int i = 0; i < itemsLen; i++)
|
||||
var tuples = new List<(BaseItemDto Item, List<Guid>? AncestorIds, BaseItemDto TopParent, IEnumerable<string> UserDataKey, List<string> InheritedTags)>();
|
||||
foreach (var item in items.GroupBy(e => e.Id).Select(e => e.Last()))
|
||||
{
|
||||
var item = items[i];
|
||||
var ancestorIds = item.SupportsAncestors ?
|
||||
item.GetAncestorIds().Distinct().ToList() :
|
||||
null;
|
||||
@@ -371,7 +370,7 @@ public sealed class BaseItemRepository(
|
||||
var userdataKey = item.GetUserDataKeys();
|
||||
var inheritedTags = item.GetInheritedTags();
|
||||
|
||||
tuples[i] = (item, ancestorIds, topParent, userdataKey, inheritedTags);
|
||||
tuples.Add((item, ancestorIds, topParent, userdataKey, inheritedTags));
|
||||
}
|
||||
|
||||
var localFuckingItemValueCache = new Dictionary<(int MagicNumber, string Value), Guid>();
|
||||
|
||||
Reference in New Issue
Block a user