mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-18 15:13:55 +02:00
Use Distinct() to filter out duplicates when adding items to playlist
This commit is contained in:
parent
487aa376b4
commit
d276e0f8f4
1 changed files with 1 additions and 2 deletions
|
|
@ -202,8 +202,7 @@ namespace Emby.Server.Implementations.Playlists
|
|||
var existingIds = playlist.LinkedChildren.Select(c => c.ItemId).ToHashSet();
|
||||
var uniqueItems = items
|
||||
.Where(i => !existingIds.Contains(i.Id))
|
||||
.GroupBy(i => i.Id)
|
||||
.Select(group => group.First())
|
||||
.Distinct()
|
||||
.Select(i => LinkedChild.Create(i))
|
||||
.ToList();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue