mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Use Distinct() to filter out duplicates when adding items to playlist
This commit is contained in:
parent
487aa376b4
commit
d276e0f8f4
@ -202,8 +202,7 @@ namespace Emby.Server.Implementations.Playlists
|
|||||||
var existingIds = playlist.LinkedChildren.Select(c => c.ItemId).ToHashSet();
|
var existingIds = playlist.LinkedChildren.Select(c => c.ItemId).ToHashSet();
|
||||||
var uniqueItems = items
|
var uniqueItems = items
|
||||||
.Where(i => !existingIds.Contains(i.Id))
|
.Where(i => !existingIds.Contains(i.Id))
|
||||||
.GroupBy(i => i.Id)
|
.Distinct()
|
||||||
.Select(group => group.First())
|
|
||||||
.Select(i => LinkedChild.Create(i))
|
.Select(i => LinkedChild.Create(i))
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user