implement removing from playlists

This commit is contained in:
Luke Pulverenti
2014-08-11 19:41:11 -04:00
parent 7bff666136
commit 9b92cc20f2
13 changed files with 51 additions and 15 deletions

View File

@@ -1,7 +1,7 @@
using System.Collections.Generic;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Playlists;
using System.Collections.Generic;
using System.IO;
using System.Linq;

View File

@@ -193,13 +193,14 @@ namespace MediaBrowser.Server.Implementations.Playlists
throw new ArgumentException("No Playlist exists with the supplied Id");
}
var children = playlist.LinkedChildren.ToList();
var children = playlist.GetManageableItems().ToList();
var idList = entryIds.ToList();
var removals = children.Where(i => idList.Contains(i.Id));
var removals = children.Where(i => idList.Contains(i.Item1.Id));
playlist.LinkedChildren = children.Except(removals)
.Select(i => i.Item1)
.ToList();
await playlist.UpdateToRepository(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false);