The Free Software Media System - Server Backend & API
hide library monitor from certain operating systems
Luke Pulverenti0ee844dd46f9
diff --git a/MediaBrowser.Controller/IServerApplicationHost.cs b/MediaBrowser.Controller/IServerApplicationHost.csindex d202e221e0..1b842a5f62 100644--- a/MediaBrowser.Controller/IServerApplicationHost.cs+++ b/MediaBrowser.Controller/IServerApplicationHost.cs@@ -23,6 +23,12 @@ namespace MediaBrowser.Controller/// <value><c>true</c> if [supports automatic run at startup]; otherwise, <c>false</c>.</value>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>diff --git a/MediaBrowser.Model/System/SystemInfo.cs b/MediaBrowser.Model/System/SystemInfo.csindex c8209baa85..e3e8c7be23 100644--- a/MediaBrowser.Model/System/SystemInfo.cs+++ b/MediaBrowser.Model/System/SystemInfo.cs@@ -39,11 +39,11 @@ namespace MediaBrowser.Model.Systempublic 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.csindex cb9d5a09fa..1f545916a4 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.IOprivate 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.csindex 3b2d145881..d0ceb9e09b 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.csindex e63adaebd1..aa4f5a040e 100644--- a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs+++ b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs@@ -260,6 +260,11 @@ namespace MediaBrowser.Server.Startup.Commonget { return NativeApp.SupportsRunningAsService; }}+ public bool SupportsLibraryMonitor+ {+ get { return NativeApp.SupportsLibraryMonitor; }+ }+/// <summary>/// Gets the name./// </summary>@@ -1072,7 +1077,7 @@ namespace MediaBrowser.Server.Startup.CommonSupportsRunningAsService = SupportsRunningAsService,ServerName = FriendlyName,LocalAddress = LocalApiUrl,- SupportsSync = true+ SupportsLibraryMonitor = SupportsLibraryMonitor};}diff --git a/MediaBrowser.Server.Startup.Common/INativeApp.cs b/MediaBrowser.Server.Startup.Common/INativeApp.csindex 01bc069a77..597caf34cc 100644--- a/MediaBrowser.Server.Startup.Common/INativeApp.cs+++ b/MediaBrowser.Server.Startup.Common/INativeApp.cs@@ -52,6 +52,12 @@ namespace MediaBrowser.Server.Startup.Common/// <value><c>true</c> if [supports autorun at startup]; otherwise, <c>false</c>.</value>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>diff --git a/MediaBrowser.ServerApplication/Native/WindowsApp.cs b/MediaBrowser.ServerApplication/Native/WindowsApp.csindex bad1aaf35e..956ba52768 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