aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2017-03-24 11:04:34 -0400
committerGitHub <noreply@github.com>2017-03-24 11:04:34 -0400
commite96b9cb05c3c5d71adf5918f862dfb66155ca0ea (patch)
tree2c202f33338bbcf2bc67c902e815c836afdb85b1 /Emby.Server.Implementations
parent410a75d03d9904cd3e8c33b11ac8a85cfd3f7f42 (diff)
parentaa8f3cd493509ce4d6af836d3f231e7437a8ae49 (diff)
Merge pull request #2543 from MediaBrowser/dev
Dev
Diffstat (limited to 'Emby.Server.Implementations')
-rw-r--r--Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs27
1 files changed, 27 insertions, 0 deletions
diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
index eea562524..3bd2dd1bf 100644
--- a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
+++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
@@ -710,7 +710,34 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
throw new InvalidOperationException("SeriesId for program not found");
}
+ // If any timers have already been manually created, make sure they don't get cancelled
+ var existingTimers = (await GetTimersAsync(CancellationToken.None).ConfigureAwait(false))
+ .Where(i =>
+ {
+ if (string.Equals(i.ProgramId, info.ProgramId, StringComparison.OrdinalIgnoreCase) && !string.IsNullOrWhiteSpace(info.ProgramId))
+ {
+ return true;
+ }
+
+ //if (string.Equals(i.SeriesId, info.SeriesId, StringComparison.OrdinalIgnoreCase) && !string.IsNullOrWhiteSpace(info.SeriesId))
+ //{
+ // return true;
+ //}
+
+ return false;
+ })
+ .ToList();
+
_seriesTimerProvider.Add(info);
+
+ foreach (var timer in existingTimers)
+ {
+ timer.SeriesTimerId = info.Id;
+ timer.IsManual = true;
+
+ _timerProvider.AddOrUpdate(timer);
+ }
+
await UpdateTimersForSeriesTimer(epgData, info, true, false).ConfigureAwait(false);
return info.Id;