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 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 New Issue
Block a user