/// <summary>
 /// Get all items from playlist
 /// </summary>
 public async Task<IMediaItemList<MediaDetailsBase>> GetItems(Playlist playlist, AllFields fields, int? startIndex, int? endIndex)
 {
     List<JsonParam> parameters = new List<JsonParam>();
     parameters.Add(new JsonParam("playlistid", playlist.Id));
     parameters.AddRange(ClientUtils.GetLimitsParameter(startIndex, endIndex));
     parameters.Add(new JsonParam("properties", fields ?? AllFields.All));
     return await _client.PostAsync("Playlist.GetItems", _serializer.Parse<XbmcItemList<MediaDetailsBase>>, parameters.ToArray());
 }
 /// <summary>
 /// Get all items from playlist
 /// </summary>
 public async Task<IMediaItemList<MediaDetailsBase>> GetItems(Playlist playlist)
 {
     return await GetItems(playlist, null, null, null);
 }
 /// <summary>
 /// Clear playlist
 /// </summary>
 public async Task Clear(Playlist playlist)
 {
     await _client.PostWithoutResultAsync("Playlist.Clear", new JsonParam("playlistid", playlist.Id));
 }
 /// <summary>
 /// Swap items in the playlist. Does not work for picture playlists (aka slideshows).
 /// </summary>
 public async Task Swap(Playlist playlist, int position1, int position2)
 {
     await _client.PostWithoutResultAsync("Playlist.Swap", new JsonParam("playlistid", playlist.Id), new JsonParam("position1", position1), new JsonParam("position2", position2));
 }
 /// <summary>
 /// Remove item from playlist. Does not work for picture playlists (aka slideshows).
 /// </summary>
 public async Task Remove(Playlist playlist, int position)
 {
     await _client.PostWithoutResultAsync("Playlist.Remove", new JsonParam("playlistid", playlist.Id), new JsonParam("position", position));
 }
 /// <summary>
 /// Insert item(s) into playlist. Does not work for picture playlists (aka slideshows).
 /// </summary>
 public async Task Insert(Playlist playlist, int position, MediaDetailsBase item)
 {
     JsonParam itemParam = GetMediaItemParam(item);
     await _client.PostWithoutResultAsync("Playlist.Insert", new JsonParam("playlistid", playlist.Id), new JsonParam("position", position), itemParam);
 }
 /// <summary>
 /// Add playlist Item
 /// </summary>
 public async Task Add(Playlist playlist, XbmcItemBase item)
 {
     JsonParam itemParam = GetMediaItemParam(item);
     await _client.PostWithoutResultAsync("Playlist.Add", new JsonParam("playlistid", playlist.Id), itemParam);
 }