From b30bd9a1dfc52ff4581183acf5ddb214efc518da Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 11 Feb 2016 23:54:00 -0500 Subject: update recording deletion process --- MediaBrowser.Controller/Entities/BaseItem.cs | 5 +++++ MediaBrowser.Controller/Library/LibraryManagerExtensions.cs | 8 -------- MediaBrowser.Controller/LiveTv/ILiveTvManager.cs | 7 +++++++ MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs | 7 +++++++ MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs | 7 +++++++ 5 files changed, 26 insertions(+), 8 deletions(-) (limited to 'MediaBrowser.Controller') diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index 379697b816..d52e2b37fb 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -1980,5 +1980,10 @@ namespace MediaBrowser.Controller.Entities { return new[] { Id }; } + + public virtual Task Delete(DeleteOptions options) + { + return LibraryManager.DeleteItem(this, options); + } } } \ No newline at end of file diff --git a/MediaBrowser.Controller/Library/LibraryManagerExtensions.cs b/MediaBrowser.Controller/Library/LibraryManagerExtensions.cs index dd1c9c07a9..4c9831bf94 100644 --- a/MediaBrowser.Controller/Library/LibraryManagerExtensions.cs +++ b/MediaBrowser.Controller/Library/LibraryManagerExtensions.cs @@ -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)); diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs index 241b01405a..3d9354433f 100644 --- a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs +++ b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs @@ -44,6 +44,13 @@ namespace MediaBrowser.Controller.LiveTv /// Task. Task DeleteRecording(string id); + /// + /// Deletes the recording. + /// + /// The recording. + /// Task. + Task DeleteRecording(ILiveTvRecording recording); + /// /// Cancels the timer. /// diff --git a/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs b/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs index d9834c191b..c3d843f85a 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs @@ -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); + } } } diff --git a/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs b/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs index c58b5502b2..5492a29f30 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs @@ -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); + } } } -- cgit v1.2.3