hide library monitor from certain operating systems

This commit is contained in:
Luke Pulverenti 2015-10-03 14:13:53 -04:00
parent 63b218be44
commit 0ee844dd46
7 changed files with 39 additions and 5 deletions

View file

@ -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>

View file

@ -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>

View file

@ -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:

View file

@ -109,6 +109,11 @@ namespace MediaBrowser.Server.Mono.Native
}
}
public bool SupportsLibraryMonitor
{
get { return false; }
}
public void ConfigureAutoRun(bool autorun)
{
}

View file

@ -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
};
}

View file

@ -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>

View file

@ -47,6 +47,11 @@ namespace MediaBrowser.ServerApplication.Native
}
}
public bool SupportsLibraryMonitor
{
get { return true; }
}
public bool SupportsRunningAsService
{
get