From 66ccb313c2037ddbce7a101c97bc5746547b3243 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 17 Aug 2015 12:52:56 -0400 Subject: [PATCH] recording fixes --- .../Library/UserViewManager.cs | 1 - .../LiveTv/EmbyTV/EmbyTV.cs | 11 ++++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/MediaBrowser.Server.Implementations/Library/UserViewManager.cs b/MediaBrowser.Server.Implementations/Library/UserViewManager.cs index a609c53ab..43f77ec49 100644 --- a/MediaBrowser.Server.Implementations/Library/UserViewManager.cs +++ b/MediaBrowser.Server.Implementations/Library/UserViewManager.cs @@ -224,7 +224,6 @@ namespace MediaBrowser.Server.Implementations.Library if (enableUserSpecificViews) { - viewType = enableRichView ? viewType : null; var view = await _libraryManager.GetNamedView(user, name, viewType, sortName, cancellationToken).ConfigureAwait(false); if (view.ParentId != parentId) diff --git a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs index 5779be84f..14c3887df 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs @@ -177,6 +177,12 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV public Task CancelSeriesTimerAsync(string timerId, CancellationToken cancellationToken) { + var timers = _timerProvider.GetAll().Where(i => string.Equals(i.SeriesTimerId, timerId, StringComparison.OrdinalIgnoreCase)); + foreach (var timer in timers) + { + CancelTimerInternal(timer.Id); + } + var remove = _seriesTimerProvider.GetAll().FirstOrDefault(r => string.Equals(r.Id, timerId, StringComparison.OrdinalIgnoreCase)); if (remove != null) { @@ -583,7 +589,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV { using (var output = File.Open(recordPath, FileMode.Create, FileAccess.Write, FileShare.Read)) { - await response.Content.CopyToAsync(output, 131072, linkedToken); + await response.Content.CopyToAsync(output, StreamDefaults.DefaultCopyToBufferSize, linkedToken); } } @@ -659,6 +665,9 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV private IEnumerable GetTimersForSeries(SeriesTimerInfo seriesTimer, IEnumerable allPrograms, IReadOnlyList currentRecordings) { + // Exclude programs that have already ended + allPrograms = allPrograms.Where(i => i.EndDate > DateTime.UtcNow); + allPrograms = GetProgramsForSeries(seriesTimer, allPrograms); var recordingShowIds = currentRecordings.Select(i => i.ShowId).ToList();