From b97491cdad6d5df3ba2bf050321e06129d281bd0 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 19 Mar 2016 17:34:43 -0400 Subject: [PATCH] reduce use of ILiveTvRecording --- MediaBrowser.Controller/LiveTv/ILiveTvManager.cs | 6 +++--- .../LiveTv/LiveTvManager.cs | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs index a8f847f53..bd25b23f7 100644 --- a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs +++ b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs @@ -50,7 +50,7 @@ namespace MediaBrowser.Controller.LiveTv /// /// The recording. /// Task. - Task DeleteRecording(ILiveTvRecording recording); + Task DeleteRecording(BaseItem recording); /// /// Cancels the timer. @@ -156,7 +156,7 @@ namespace MediaBrowser.Controller.LiveTv /// The identifier. /// The cancellation token. /// LiveTvRecording. - Task GetInternalRecording(string id, CancellationToken cancellationToken); + Task GetInternalRecording(string id, CancellationToken cancellationToken); /// /// Gets the recording stream. @@ -396,7 +396,7 @@ namespace MediaBrowser.Controller.LiveTv /// /// The recording. /// Task. - Task OnRecordingFileDeleted(ILiveTvRecording recording); + Task OnRecordingFileDeleted(BaseItem recording); /// /// Gets the sat ini mappings. diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs index 5949a6537..47379fcb0 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs @@ -300,7 +300,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv return _libraryManager.GetItemById(id) as LiveTvProgram; } - public async Task GetInternalRecording(string id, CancellationToken cancellationToken) + public async Task GetInternalRecording(string id, CancellationToken cancellationToken) { if (string.IsNullOrWhiteSpace(id)) { @@ -313,7 +313,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv }, cancellationToken).ConfigureAwait(false); - return result.Items.FirstOrDefault() as ILiveTvRecording; + return result.Items.FirstOrDefault(); } private readonly SemaphoreSlim _liveStreamSemaphore = new SemaphoreSlim(1, 1); @@ -1698,7 +1698,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv }; } - public Task OnRecordingFileDeleted(ILiveTvRecording recording) + public Task OnRecordingFileDeleted(BaseItem recording) { var service = GetService(recording); @@ -1720,10 +1720,10 @@ namespace MediaBrowser.Server.Implementations.LiveTv throw new ResourceNotFoundException(string.Format("Recording with Id {0} not found", recordingId)); } - await DeleteRecording(recording).ConfigureAwait(false); + await DeleteRecording((BaseItem)recording).ConfigureAwait(false); } - public async Task DeleteRecording(ILiveTvRecording recording) + public async Task DeleteRecording(BaseItem recording) { var service = GetService(recording.ServiceName);