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