Exit method early if there are no unique playlist items to add
This commit is contained in:
parent
4d32b59a0b
commit
6438771212
|
@ -214,6 +214,12 @@ namespace Emby.Server.Implementations.Playlists
|
||||||
_logger.LogWarning("Ignored adding {DuplicateCount} duplicate items to playlist {PlaylistName}.", numDuplicates, playlist.Name);
|
_logger.LogWarning("Ignored adding {DuplicateCount} duplicate items to playlist {PlaylistName}.", numDuplicates, playlist.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Do nothing else if there are no items to add to the playlist
|
||||||
|
if (uniqueItems.Length == 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Create a new array with the updated playlist items
|
// Create a new array with the updated playlist items
|
||||||
var newLinkedChildren = new LinkedChild[playlist.LinkedChildren.Length + uniqueItems.Length];
|
var newLinkedChildren = new LinkedChild[playlist.LinkedChildren.Length + uniqueItems.Length];
|
||||||
playlist.LinkedChildren.CopyTo(newLinkedChildren, 0);
|
playlist.LinkedChildren.CopyTo(newLinkedChildren, 0);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user