diff --git a/MediaBrowser.Common.Implementations/ScheduledTasks/ScheduledTaskWorker.cs b/MediaBrowser.Common.Implementations/ScheduledTasks/ScheduledTaskWorker.cs index 52612c4c1..95f29915d 100644 --- a/MediaBrowser.Common.Implementations/ScheduledTasks/ScheduledTaskWorker.cs +++ b/MediaBrowser.Common.Implementations/ScheduledTasks/ScheduledTaskWorker.cs @@ -13,7 +13,6 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; using CommonIO; -using MediaBrowser.Common.IO; namespace MediaBrowser.Common.Implementations.ScheduledTasks { @@ -304,6 +303,11 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks } } + public void ReloadTriggerEvents() + { + ReloadTriggerEvents(false); + } + /// /// Reloads the trigger events. /// diff --git a/MediaBrowser.Common.Implementations/ScheduledTasks/TaskManager.cs b/MediaBrowser.Common.Implementations/ScheduledTasks/TaskManager.cs index 6c72441aa..845c984fb 100644 --- a/MediaBrowser.Common.Implementations/ScheduledTasks/TaskManager.cs +++ b/MediaBrowser.Common.Implementations/ScheduledTasks/TaskManager.cs @@ -12,6 +12,7 @@ using System.Linq; using System.Threading.Tasks; using CommonIO; using MediaBrowser.Common.IO; +using Microsoft.Win32; namespace MediaBrowser.Common.Implementations.ScheduledTasks { @@ -69,6 +70,28 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks _fileSystem = fileSystem; ScheduledTasks = new IScheduledTaskWorker[] { }; + + BindToSystemEvent(); + } + + private void BindToSystemEvent() + { + try + { + SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged; + } + catch + { + + } + } + + void SystemEvents_PowerModeChanged(object sender, PowerModeChangedEventArgs e) + { + foreach (var task in ScheduledTasks) + { + task.ReloadTriggerEvents(); + } } /// @@ -127,7 +150,7 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks { QueueScheduledTask(new TaskExecutionOptions()); } - + /// /// Queues the scheduled task. /// diff --git a/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs b/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs index ae3c43d7e..e36ff9950 100644 --- a/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs +++ b/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs @@ -19,7 +19,7 @@ namespace MediaBrowser.Common.Implementations.Security public class PluginSecurityManager : ISecurityManager { private const string MBValidateUrl = MbAdmin.HttpsUrl + "service/registration/validate"; - private const string AppstoreRegUrl = /*MbAdmin.HttpsUrl*/ "http://mb3admin.com/test/admin/" + "service/appstore/register"; + private const string AppstoreRegUrl = /*MbAdmin.HttpsUrl*/ "http://mb3admin.com/admin/" + "service/appstore/register"; /// /// The _is MB supporter @@ -199,7 +199,7 @@ namespace MediaBrowser.Common.Implementations.Security Url = AppstoreRegUrl, CancellationToken = CancellationToken.None }; - options.RequestHeaders.Add("X-Emby-Token", /*_appHost.SystemId*/ "08606E86D043"); + options.RequestHeaders.Add("X-Emby-Token", _appHost.SystemId); options.RequestContent = parameters; options.RequestContentType = "application/json"; diff --git a/MediaBrowser.Common/ScheduledTasks/IScheduledTaskWorker.cs b/MediaBrowser.Common/ScheduledTasks/IScheduledTaskWorker.cs index f50bd9e76..0b9a5e276 100644 --- a/MediaBrowser.Common/ScheduledTasks/IScheduledTaskWorker.cs +++ b/MediaBrowser.Common/ScheduledTasks/IScheduledTaskWorker.cs @@ -69,5 +69,10 @@ namespace MediaBrowser.Common.ScheduledTasks /// /// The unique id. string Id { get; } + + /// + /// Reloads the trigger events. + /// + void ReloadTriggerEvents(); } } \ No newline at end of file diff --git a/Nuget/MediaBrowser.Common.Internal.nuspec b/Nuget/MediaBrowser.Common.Internal.nuspec index 1c14f9544..8fa5b665d 100644 --- a/Nuget/MediaBrowser.Common.Internal.nuspec +++ b/Nuget/MediaBrowser.Common.Internal.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Common.Internal - 3.0.637 + 3.0.638 MediaBrowser.Common.Internal Luke ebr,Luke,scottisafool @@ -12,7 +12,7 @@ Contains common components shared by Emby Theater and Emby Server. Not intended for plugin developer consumption. Copyright © Emby 2013 - + diff --git a/Nuget/MediaBrowser.Common.nuspec b/Nuget/MediaBrowser.Common.nuspec index 166ece453..cec3f63d5 100644 --- a/Nuget/MediaBrowser.Common.nuspec +++ b/Nuget/MediaBrowser.Common.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Common - 3.0.637 + 3.0.638 MediaBrowser.Common Emby Team ebr,Luke,scottisafool diff --git a/Nuget/MediaBrowser.Model.Signed.nuspec b/Nuget/MediaBrowser.Model.Signed.nuspec index 33a0c5edf..6f778882a 100644 --- a/Nuget/MediaBrowser.Model.Signed.nuspec +++ b/Nuget/MediaBrowser.Model.Signed.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Model.Signed - 3.0.637 + 3.0.638 MediaBrowser.Model - Signed Edition Emby Team ebr,Luke,scottisafool diff --git a/Nuget/MediaBrowser.Server.Core.nuspec b/Nuget/MediaBrowser.Server.Core.nuspec index 53476dc1f..b6edd8719 100644 --- a/Nuget/MediaBrowser.Server.Core.nuspec +++ b/Nuget/MediaBrowser.Server.Core.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Server.Core - 3.0.637 + 3.0.638 Media Browser.Server.Core Emby Team ebr,Luke,scottisafool @@ -12,7 +12,7 @@ Contains core components required to build plugins for Emby Server. Copyright © Emby 2013 - + diff --git a/SharedVersion.cs b/SharedVersion.cs index ab168e6ea..b826a98f1 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,4 +1,4 @@ using System.Reflection; -[assembly: AssemblyVersion("3.0.*")] -//[assembly: AssemblyVersion("3.0.5768.5")] +//[assembly: AssemblyVersion("3.0.*")] +[assembly: AssemblyVersion("3.0.5768.6")]