update power management

This commit is contained in:
Luke Pulverenti
2016-11-08 23:58:58 -05:00
parent 15ebff2b3a
commit 24532f3e2d
20 changed files with 254 additions and 178 deletions

View File

@@ -320,8 +320,9 @@ namespace MediaBrowser.ServerApplication
logManager,
options,
fileSystem,
"emby.windows.zip",
nativeApp);
nativeApp,
new PowerManagement(),
"emby.windows.zip");
var initProgress = new Progress<double>();

View File

@@ -127,6 +127,7 @@
<Compile Include="Native\LnkShortcutHandler.cs" />
<Compile Include="Native\DbConnector.cs" />
<Compile Include="Native\LoopbackUtil.cs" />
<Compile Include="Native\PowerManagement.cs" />
<Compile Include="Native\Standby.cs" />
<Compile Include="Native\ServerAuthorization.cs" />
<Compile Include="Native\WindowsApp.cs" />

View File

@@ -0,0 +1,17 @@
using MediaBrowser.Model.System;
namespace MediaBrowser.ServerApplication.Native
{
public class PowerManagement : IPowerManagement
{
public void PreventSystemStandby()
{
MainStartup.Invoke(Standby.PreventSleep);
}
public void AllowSystemStandby()
{
MainStartup.Invoke(Standby.AllowSleep);
}
}
}

View File

@@ -139,16 +139,6 @@ namespace MediaBrowser.ServerApplication.Native
return new NetworkManager(logger);
}
public void PreventSystemStandby()
{
MainStartup.Invoke(Standby.PreventSleep);
}
public void AllowSystemStandby()
{
MainStartup.Invoke(Standby.AllowSleep);
}
public FFMpegInstallInfo GetFfmpegInstallInfo()
{
var info = new FFMpegInstallInfo();