aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/LiveTv
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2016-12-13 13:27:53 -0500
committerGitHub <noreply@github.com>2016-12-13 13:27:53 -0500
commit6cdbb25b9d756b58806414455cc4c4d1bc555217 (patch)
treeb6bc4f10ad1c6f758215a719b2be932b5979e896 /Emby.Server.Implementations/LiveTv
parentb33dcdf7bd61a8096928e1b2b5e34af1c8373096 (diff)
parentffad9c27e4844eeab235f88cb45739370d22a83a (diff)
Merge pull request #2340 from MediaBrowser/dev
Dev
Diffstat (limited to 'Emby.Server.Implementations/LiveTv')
-rw-r--r--Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs22
-rw-r--r--Emby.Server.Implementations/LiveTv/EmbyTV/RecordingHelper.cs6
-rw-r--r--Emby.Server.Implementations/LiveTv/LiveTvManager.cs1
3 files changed, 28 insertions, 1 deletions
diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
index f5bef058d2..84a255c7a9 100644
--- a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
+++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
@@ -328,15 +328,35 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
}
await UpdateTimersForSeriesTimer(epgData, timer, true).ConfigureAwait(false);
}
+ }
+ public async Task RefreshTimers(CancellationToken cancellationToken, IProgress<double> progress)
+ {
var timers = await GetTimersAsync(cancellationToken).ConfigureAwait(false);
- foreach (var timer in timers.ToList())
+ foreach (var timer in timers)
{
if (DateTime.UtcNow > timer.EndDate && !_activeRecordings.ContainsKey(timer.Id))
{
OnTimerOutOfDate(timer);
+ continue;
+ }
+
+ if (string.IsNullOrWhiteSpace(timer.ProgramId) || string.IsNullOrWhiteSpace(timer.ChannelId))
+ {
+ continue;
+ }
+
+ var epg = GetEpgDataForChannel(timer.ChannelId);
+ var program = epg.FirstOrDefault(i => string.Equals(i.Id, timer.ProgramId, StringComparison.OrdinalIgnoreCase));
+ if (program == null)
+ {
+ OnTimerOutOfDate(timer);
+ continue;
}
+
+ RecordingHelper.CopyProgramInfoToTimerInfo(program, timer);
+ _timerProvider.Update(timer);
}
}
diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/RecordingHelper.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/RecordingHelper.cs
index 881aaaf0d6..a5b19ff524 100644
--- a/Emby.Server.Implementations/LiveTv/EmbyTV/RecordingHelper.cs
+++ b/Emby.Server.Implementations/LiveTv/EmbyTV/RecordingHelper.cs
@@ -41,6 +41,11 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
public static void CopyProgramInfoToTimerInfo(ProgramInfo programInfo, TimerInfo timerInfo)
{
+ timerInfo.Name = programInfo.Name;
+ timerInfo.StartDate = programInfo.StartDate;
+ timerInfo.EndDate = programInfo.EndDate;
+ timerInfo.ChannelId = programInfo.ChannelId;
+
timerInfo.SeasonNumber = programInfo.SeasonNumber;
timerInfo.EpisodeNumber = programInfo.EpisodeNumber;
timerInfo.IsMovie = programInfo.IsMovie;
@@ -54,6 +59,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
timerInfo.HomePageUrl = programInfo.HomePageUrl;
timerInfo.CommunityRating = programInfo.CommunityRating;
+ timerInfo.Overview = programInfo.Overview;
timerInfo.ShortOverview = programInfo.ShortOverview;
timerInfo.OfficialRating = programInfo.OfficialRating;
timerInfo.IsRepeat = programInfo.IsRepeat;
diff --git a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs b/Emby.Server.Implementations/LiveTv/LiveTvManager.cs
index faf9687f40..5e12fc9b98 100644
--- a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs
+++ b/Emby.Server.Implementations/LiveTv/LiveTvManager.cs
@@ -1231,6 +1231,7 @@ namespace Emby.Server.Implementations.LiveTv
if (coreService != null)
{
await coreService.RefreshSeriesTimers(cancellationToken, new Progress<double>()).ConfigureAwait(false);
+ await coreService.RefreshTimers(cancellationToken, new Progress<double>()).ConfigureAwait(false);
}
// Load these now which will prefetch metadata