From 51cd5e90b0a926ea728f9b98e5b9f380948b5cce Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 27 Jan 2016 01:07:01 -0500 Subject: [PATCH] restart timers on wake --- .../LiveTv/EmbyTV/EmbyTV.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs index dff57adf3..c27f60712 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs @@ -30,6 +30,7 @@ using System.Threading.Tasks; using CommonIO; using MediaBrowser.Common.Extensions; using MediaBrowser.Controller.Power; +using Microsoft.Win32; namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV { @@ -84,6 +85,17 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV public void Start() { _timerProvider.RestartTimers(); + + SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged; + + } + + void SystemEvents_PowerModeChanged(object sender, PowerModeChangedEventArgs e) + { + if (e.Mode == PowerModes.Resume) + { + _timerProvider.RestartTimers(); + } } public event EventHandler DataSourceChanged;