Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. public boolean PlaylistHasItem(string playlistId,Guid itemID)
  2. {
  3. var playlist = _libraryManager.GetItemById(playlistId) as Playlist;
  4.  
  5. if (playlist == null)
  6. {
  7. throw new ArgumentException("No Playlist exists with the supplied Id");
  8. }
  9.  
  10. var playlistItems = playlist.LinkedChildren.ToList();
  11.  
  12. foreach (var item in playlistItems)
  13. {
  14. if (item.id == itemID)
  15. {
  16. return true;
  17. }
  18. }
  19.  
  20. return false;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement