diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-10-03 14:13:53 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-10-03 14:13:53 -0400 |
| commit | 0ee844dd46f98a009c656afb3ca8618902a725d8 (patch) | |
| tree | 00c46f351256c074c249d64078a2f6c276a6f3a0 | |
| parent | 63b218be44656a7ff81b22441941611178d26847 (diff) | |
hide library monitor from certain operating systems
7 files changed, 39 insertions, 5 deletions
diff --git a/MediaBrowser.Controller/IServerApplicationHost.cs b/MediaBrowser.Controller/IServerApplicationHost.cs index d202e221e..1b842a5f6 100644 --- a/MediaBrowser.Controller/IServerApplicationHost.cs +++ b/MediaBrowser.Controller/IServerApplicationHost.cs @@ -24,6 +24,12 @@ namespace MediaBrowser.Controller bool SupportsAutoRunAtStartup { get; } /// <summary> + /// Gets a value indicating whether [supports library monitor]. + /// </summary> + /// <value><c>true</c> if [supports library monitor]; otherwise, <c>false</c>.</value> + bool SupportsLibraryMonitor { get; } + + /// <summary> /// Gets the HTTP server port. /// </summary> /// <value>The HTTP server port.</value> diff --git a/MediaBrowser.Model/System/SystemInfo.cs b/MediaBrowser.Model/System/SystemInfo.cs index c8209baa8..e3e8c7be2 100644 --- a/MediaBrowser.Model/System/SystemInfo.cs +++ b/MediaBrowser.Model/System/SystemInfo.cs @@ -39,11 +39,11 @@ namespace MediaBrowser.Model.System public bool HasPendingRestart { get; set; } /// <summary> - /// Gets or sets a value indicating whether [supports synchronize]. + /// Gets or sets a value indicating whether [supports library monitor]. /// </summary> - /// <value><c>true</c> if [supports synchronize]; otherwise, <c>false</c>.</value> - public bool SupportsSync { get; set; } - + /// <value><c>true</c> if [supports library monitor]; otherwise, <c>false</c>.</value> + public bool SupportsLibraryMonitor { get; set; } + /// <summary> /// Gets or sets a value indicating whether this instance is network deployed. /// </summary> diff --git a/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs b/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs index cb9d5a09f..1f545916a 100644 --- a/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs +++ b/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs @@ -15,6 +15,7 @@ using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; +using MediaBrowser.Controller; namespace MediaBrowser.Server.Implementations.IO { @@ -113,6 +114,7 @@ namespace MediaBrowser.Server.Implementations.IO private IServerConfigurationManager ConfigurationManager { get; set; } private readonly IFileSystem _fileSystem; + private IServerApplicationHost _appHost; /// <summary> /// Initializes a new instance of the <see cref="LibraryMonitor" /> class. @@ -153,6 +155,11 @@ namespace MediaBrowser.Server.Implementations.IO { get { + if (!_appHost.SupportsLibraryMonitor) + { + return false; + } + switch (ConfigurationManager.Configuration.EnableLibraryMonitor) { case AutoOnOff.Auto: diff --git a/MediaBrowser.Server.Mono/Native/BaseMonoApp.cs b/MediaBrowser.Server.Mono/Native/BaseMonoApp.cs index 3b2d14588..d0ceb9e09 100644 --- a/MediaBrowser.Server.Mono/Native/BaseMonoApp.cs +++ b/MediaBrowser.Server.Mono/Native/BaseMonoApp.cs @@ -109,6 +109,11 @@ namespace MediaBrowser.Server.Mono.Native } } + public bool SupportsLibraryMonitor + { + get { return false; } + } + public void ConfigureAutoRun(bool autorun) { } diff --git a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs index e63adaebd..aa4f5a040 100644 --- a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs +++ b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs @@ -260,6 +260,11 @@ namespace MediaBrowser.Server.Startup.Common get { return NativeApp.SupportsRunningAsService; } } + public bool SupportsLibraryMonitor + { + get { return NativeApp.SupportsLibraryMonitor; } + } + /// <summary> /// Gets the name. /// </summary> @@ -1072,7 +1077,7 @@ namespace MediaBrowser.Server.Startup.Common SupportsRunningAsService = SupportsRunningAsService, ServerName = FriendlyName, LocalAddress = LocalApiUrl, - SupportsSync = true + SupportsLibraryMonitor = SupportsLibraryMonitor }; } diff --git a/MediaBrowser.Server.Startup.Common/INativeApp.cs b/MediaBrowser.Server.Startup.Common/INativeApp.cs index 01bc069a7..597caf34c 100644 --- a/MediaBrowser.Server.Startup.Common/INativeApp.cs +++ b/MediaBrowser.Server.Startup.Common/INativeApp.cs @@ -53,6 +53,12 @@ namespace MediaBrowser.Server.Startup.Common bool SupportsAutoRunAtStartup { get; } /// <summary> + /// Gets a value indicating whether [supports library monitor]. + /// </summary> + /// <value><c>true</c> if [supports library monitor]; otherwise, <c>false</c>.</value> + bool SupportsLibraryMonitor { get; } + + /// <summary> /// Gets a value indicating whether this instance can self update. /// </summary> /// <value><c>true</c> if this instance can self update; otherwise, <c>false</c>.</value> diff --git a/MediaBrowser.ServerApplication/Native/WindowsApp.cs b/MediaBrowser.ServerApplication/Native/WindowsApp.cs index bad1aaf35..956ba5276 100644 --- a/MediaBrowser.ServerApplication/Native/WindowsApp.cs +++ b/MediaBrowser.ServerApplication/Native/WindowsApp.cs @@ -47,6 +47,11 @@ namespace MediaBrowser.ServerApplication.Native } } + public bool SupportsLibraryMonitor + { + get { return true; } + } + public bool SupportsRunningAsService { get |
