update recording deletion process

This commit is contained in:
Luke Pulverenti
2016-02-11 23:54:00 -05:00
parent e04582c9d2
commit b30bd9a1df
10 changed files with 57 additions and 22 deletions

View File

@@ -1980,5 +1980,10 @@ namespace MediaBrowser.Controller.Entities
{
return new[] { Id };
}
public virtual Task Delete(DeleteOptions options)
{
return LibraryManager.DeleteItem(this, options);
}
}
}

View File

@@ -6,14 +6,6 @@ namespace MediaBrowser.Controller.Library
{
public static class LibraryManagerExtensions
{
public static Task DeleteItem(this ILibraryManager manager, BaseItem item)
{
return manager.DeleteItem(item, new DeleteOptions
{
DeleteFileLocation = true
});
}
public static BaseItem GetItemById(this ILibraryManager manager, string id)
{
return manager.GetItemById(new Guid(id));

View File

@@ -44,6 +44,13 @@ namespace MediaBrowser.Controller.LiveTv
/// <returns>Task.</returns>
Task DeleteRecording(string id);
/// <summary>
/// Deletes the recording.
/// </summary>
/// <param name="recording">The recording.</param>
/// <returns>Task.</returns>
Task DeleteRecording(ILiveTvRecording recording);
/// <summary>
/// Cancels the timer.
/// </summary>

View File

@@ -9,6 +9,8 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Threading.Tasks;
using MediaBrowser.Controller.Library;
namespace MediaBrowser.Controller.LiveTv
{
@@ -144,5 +146,10 @@ namespace MediaBrowser.Controller.LiveTv
{
return IsVisible(user);
}
public override Task Delete(DeleteOptions options)
{
return LiveTvManager.DeleteRecording(this);
}
}
}

View File

@@ -9,6 +9,8 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Threading.Tasks;
using MediaBrowser.Controller.Library;
namespace MediaBrowser.Controller.LiveTv
{
@@ -159,5 +161,10 @@ namespace MediaBrowser.Controller.LiveTv
{
return IsVisible(user);
}
public override Task Delete(DeleteOptions options)
{
return LiveTvManager.DeleteRecording(this);
}
}
}