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

@@ -42,7 +42,7 @@ namespace MediaBrowser.Server.Implementations.Channels
{
return new ITaskTrigger[]
{
new StartupTrigger(),
new StartupTrigger{DelayMs = 10000},
new SystemEventTrigger{ SystemEvent = SystemEvent.WakeFromSleep},

View File

@@ -195,7 +195,8 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
{
Name = string.Format(_localization.GetLocalizedString("FailedLoginAttemptWithUserName"), e.Argument.Username),
Type = "AuthenticationFailed",
ShortOverview = string.Format(_localization.GetLocalizedString("LabelIpAddressValue"), e.Argument.RemoteEndPoint)
ShortOverview = string.Format(_localization.GetLocalizedString("LabelIpAddressValue"), e.Argument.RemoteEndPoint),
Severity = LogSeverity.Error
});
}
@@ -427,7 +428,8 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
Name = string.Format(_localization.GetLocalizedString("ScheduledTaskFailedWithName"), task.Name),
Type = "ScheduledTaskFailed",
Overview = string.Join(Environment.NewLine, vals.ToArray()),
ShortOverview = runningTime
ShortOverview = runningTime,
Severity = LogSeverity.Error
});
}
}

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);