diff options
| author | spookbits <71300703+spooksbit@users.noreply.github.com> | 2020-09-16 13:17:14 -0400 |
|---|---|---|
| committer | spookbits <71300703+spooksbit@users.noreply.github.com> | 2020-09-16 13:22:04 -0400 |
| commit | 5cca8bffea339f1043d692f337ab002dbee3a03b (patch) | |
| tree | 1a90bbcbefe27270a62830f08de79b0439d969ca /Emby.Server.Implementations/Browser/BrowserLauncher.cs | |
| parent | 6dd6961fd4649bd14501dbe5a5cd1b6a0e1fe586 (diff) | |
Removed browser auto-load functionality from the server.
Added profiles in launchSettings to start either the web client or the swagger API page.
Removed --noautorunwebapp as this is the default functionality.
Diffstat (limited to 'Emby.Server.Implementations/Browser/BrowserLauncher.cs')
| -rw-r--r-- | Emby.Server.Implementations/Browser/BrowserLauncher.cs | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/Emby.Server.Implementations/Browser/BrowserLauncher.cs b/Emby.Server.Implementations/Browser/BrowserLauncher.cs deleted file mode 100644 index f8108d1c2..000000000 --- a/Emby.Server.Implementations/Browser/BrowserLauncher.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using MediaBrowser.Controller; -using MediaBrowser.Controller.Configuration; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.Logging; - -namespace Emby.Server.Implementations.Browser -{ - /// <summary> - /// Assists in opening application URLs in an external browser. - /// </summary> - public static class BrowserLauncher - { - /// <summary> - /// Opens the home page of the web client. - /// </summary> - /// <param name="appHost">The app host.</param> - public static void OpenWebApp(IServerApplicationHost appHost) - { - TryOpenUrl(appHost, "/web/index.html"); - } - - /// <summary> - /// Opens the swagger API page. - /// </summary> - /// <param name="appHost">The app host.</param> - public static void OpenSwaggerPage(IServerApplicationHost appHost) - { - TryOpenUrl(appHost, "/api-docs/swagger"); - } - - /// <summary> - /// Opens the specified URL in an external browser window. Any exceptions will be logged, but ignored. - /// </summary> - /// <param name="appHost">The application host.</param> - /// <param name="relativeUrl">The URL to open, relative to the server base URL.</param> - private static void TryOpenUrl(IServerApplicationHost appHost, string relativeUrl) - { - try - { - string baseUrl = appHost.GetLocalApiUrl("localhost"); - appHost.LaunchUrl(baseUrl + relativeUrl); - } - catch (Exception ex) - { - var logger = appHost.Resolve<ILogger<IServerApplicationHost>>(); - logger?.LogError(ex, "Failed to open browser window with URL {URL}", relativeUrl); - } - } - } -} |
