From 4ceb9eb6c5ac2d98a5499a96cdb56af88b0e6bb6 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 9 Sep 2017 14:51:24 -0400 Subject: update restart function --- MediaBrowser.Model/System/SystemInfo.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'MediaBrowser.Model/System/SystemInfo.cs') diff --git a/MediaBrowser.Model/System/SystemInfo.cs b/MediaBrowser.Model/System/SystemInfo.cs index fce9dea4f..f9f3bf52e 100644 --- a/MediaBrowser.Model/System/SystemInfo.cs +++ b/MediaBrowser.Model/System/SystemInfo.cs @@ -36,6 +36,8 @@ namespace MediaBrowser.Model.System /// true if this instance has pending restart; otherwise, false. public bool HasPendingRestart { get; set; } + public bool IsShuttingDown { get; set; } + /// /// Gets or sets a value indicating whether [supports library monitor]. /// -- cgit v1.2.3 From f7f41e4c739f994364d842c8c8e71d6026756af1 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 10 Sep 2017 17:32:45 -0400 Subject: remove unused service properties --- Emby.Server.Implementations/ApplicationHost.cs | 17 ----------------- Emby.Server.Implementations/EntryPoints/SystemEvents.cs | 9 --------- MediaBrowser.Api/StartupWizardService.cs | 6 +----- MediaBrowser.Controller/IServerApplicationHost.cs | 6 ------ MediaBrowser.Model/System/SystemInfo.cs | 6 ------ MediaBrowser.ServerApplication/WindowsAppHost.cs | 13 ------------- 6 files changed, 1 insertion(+), 56 deletions(-) (limited to 'MediaBrowser.Model/System/SystemInfo.cs') diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 02308f79f..2b0030152 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -439,14 +439,6 @@ namespace Emby.Server.Implementations } } - public virtual bool SupportsRunningAsService - { - get - { - return false; - } - } - private DeviceId _deviceId; public string SystemId { @@ -473,14 +465,6 @@ namespace Emby.Server.Implementations } } - public virtual bool IsRunningAsService - { - get - { - return false; - } - } - private Assembly GetAssembly(Type type) { return type.GetTypeInfo().Assembly; @@ -1910,7 +1894,6 @@ namespace Emby.Server.Implementations HasUpdateAvailable = HasUpdateAvailable, SupportsAutoRunAtStartup = SupportsAutoRunAtStartup, TranscodingTempPath = ApplicationPaths.TranscodingTempPath, - SupportsRunningAsService = SupportsRunningAsService, ServerName = FriendlyName, LocalAddress = localAddress, SupportsLibraryMonitor = true, diff --git a/Emby.Server.Implementations/EntryPoints/SystemEvents.cs b/Emby.Server.Implementations/EntryPoints/SystemEvents.cs index aa63dae27..08f3edb3d 100644 --- a/Emby.Server.Implementations/EntryPoints/SystemEvents.cs +++ b/Emby.Server.Implementations/EntryPoints/SystemEvents.cs @@ -23,18 +23,9 @@ namespace Emby.Server.Implementations.EntryPoints public void Run() { - _systemEvents.SessionLogoff += _systemEvents_SessionLogoff; _systemEvents.SystemShutdown += _systemEvents_SystemShutdown; } - private void _systemEvents_SessionLogoff(object sender, EventArgs e) - { - if (!_appHost.IsRunningAsService) - { - _appHost.Shutdown(); - } - } - private void _systemEvents_SystemShutdown(object sender, EventArgs e) { _appHost.Shutdown(); diff --git a/MediaBrowser.Api/StartupWizardService.cs b/MediaBrowser.Api/StartupWizardService.cs index 7a75aeb4b..b15e06c9c 100644 --- a/MediaBrowser.Api/StartupWizardService.cs +++ b/MediaBrowser.Api/StartupWizardService.cs @@ -67,13 +67,10 @@ namespace MediaBrowser.Api _config.SaveConfiguration(); } - public async Task Get(GetStartupInfo request) + public object Get(GetStartupInfo request) { - var info = await _appHost.GetSystemInfo().ConfigureAwait(false); - return new StartupInfo { - SupportsRunningAsService = info.SupportsRunningAsService, HasMediaEncoder = !string.IsNullOrWhiteSpace(_mediaEncoder.EncoderPath) }; } @@ -152,7 +149,6 @@ namespace MediaBrowser.Api public class StartupInfo { - public bool SupportsRunningAsService { get; set; } public bool HasMediaEncoder { get; set; } } diff --git a/MediaBrowser.Controller/IServerApplicationHost.cs b/MediaBrowser.Controller/IServerApplicationHost.cs index 86b52bd77..44c003197 100644 --- a/MediaBrowser.Controller/IServerApplicationHost.cs +++ b/MediaBrowser.Controller/IServerApplicationHost.cs @@ -21,12 +21,6 @@ namespace MediaBrowser.Controller /// SystemInfo. Task GetSystemInfo(); - /// - /// Gets a value indicating whether this instance is running as service. - /// - /// true if this instance is running as service; otherwise, false. - bool IsRunningAsService { get; } - /// /// Gets a value indicating whether [supports automatic run at startup]. /// diff --git a/MediaBrowser.Model/System/SystemInfo.cs b/MediaBrowser.Model/System/SystemInfo.cs index f9f3bf52e..b61d63729 100644 --- a/MediaBrowser.Model/System/SystemInfo.cs +++ b/MediaBrowser.Model/System/SystemInfo.cs @@ -16,12 +16,6 @@ namespace MediaBrowser.Model.System /// The display name of the operating system. public string OperatingSystemDisplayName { get; set; } - /// - /// Gets or sets a value indicating whether [supports running as service]. - /// - /// true if [supports running as service]; otherwise, false. - public bool SupportsRunningAsService { get; set; } - /// /// Gets or sets the mac address. /// diff --git a/MediaBrowser.ServerApplication/WindowsAppHost.cs b/MediaBrowser.ServerApplication/WindowsAppHost.cs index a6664c42f..19079fbc9 100644 --- a/MediaBrowser.ServerApplication/WindowsAppHost.cs +++ b/MediaBrowser.ServerApplication/WindowsAppHost.cs @@ -31,11 +31,6 @@ namespace MediaBrowser.ServerApplication fileSystem.AddShortcutHandler(new LnkShortcutHandler()); } - public override bool IsRunningAsService - { - get { return MainStartup.IsRunningAsService; } - } - protected override IConnectManager CreateConnectManager() { return new ConnectManager(); @@ -111,14 +106,6 @@ namespace MediaBrowser.ServerApplication } } - public override bool SupportsRunningAsService - { - get - { - return true; - } - } - public override bool CanSelfRestart { get -- cgit v1.2.3