mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-25 03:24:47 +01:00
Add setting to auto-run web app when server starts
This commit is contained in:
@@ -148,6 +148,34 @@ namespace Emby.Server.Implementations
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool CanLaunchWebBrowser
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!Environment.UserInteractive)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (StartupOptions.ContainsOption("-service"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (EnvironmentInfo.OperatingSystem == MediaBrowser.Model.System.OperatingSystem.Windows)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (EnvironmentInfo.OperatingSystem == MediaBrowser.Model.System.OperatingSystem.OSX)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when [has pending restart changed].
|
||||
/// </summary>
|
||||
@@ -1936,6 +1964,7 @@ namespace Emby.Server.Implementations
|
||||
OperatingSystemDisplayName = OperatingSystemDisplayName,
|
||||
CanSelfRestart = CanSelfRestart,
|
||||
CanSelfUpdate = CanSelfUpdate,
|
||||
CanLaunchWebBrowser = CanLaunchWebBrowser,
|
||||
WanAddress = ConnectManager.WanApiAddress,
|
||||
HasUpdateAvailable = HasUpdateAvailable,
|
||||
SupportsAutoRunAtStartup = SupportsAutoRunAtStartup,
|
||||
@@ -2358,13 +2387,7 @@ namespace Emby.Server.Implementations
|
||||
|
||||
public virtual void LaunchUrl(string url)
|
||||
{
|
||||
if (EnvironmentInfo.OperatingSystem != MediaBrowser.Model.System.OperatingSystem.Windows &&
|
||||
EnvironmentInfo.OperatingSystem != MediaBrowser.Model.System.OperatingSystem.OSX)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
if (!Environment.UserInteractive)
|
||||
if (!CanLaunchWebBrowser)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user