From 9b92cc20f2a365018b349e1aba87fdd74e21f965 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 11 Aug 2014 19:41:11 -0400 Subject: implement removing from playlists --- .../Playlists/ManualPlaylistsFolder.cs | 4 ++-- MediaBrowser.Server.Implementations/Playlists/PlaylistManager.cs | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'MediaBrowser.Server.Implementations/Playlists') diff --git a/MediaBrowser.Server.Implementations/Playlists/ManualPlaylistsFolder.cs b/MediaBrowser.Server.Implementations/Playlists/ManualPlaylistsFolder.cs index a87edde7ba..e7e53181c9 100644 --- a/MediaBrowser.Server.Implementations/Playlists/ManualPlaylistsFolder.cs +++ b/MediaBrowser.Server.Implementations/Playlists/ManualPlaylistsFolder.cs @@ -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; diff --git a/MediaBrowser.Server.Implementations/Playlists/PlaylistManager.cs b/MediaBrowser.Server.Implementations/Playlists/PlaylistManager.cs index d461773522..3cdea07935 100644 --- a/MediaBrowser.Server.Implementations/Playlists/PlaylistManager.cs +++ b/MediaBrowser.Server.Implementations/Playlists/PlaylistManager.cs @@ -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); -- cgit v1.2.3