mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-09 12:58:37 +02:00
51 lines
1.4 KiB
C#
51 lines
1.4 KiB
C#
using System;
|
|
using MediaBrowser.Controller;
|
|
|
|
namespace Emby.Server.Implementations.Browser
|
|
{
|
|
/// <summary>
|
|
/// Class BrowserLauncher.
|
|
/// </summary>
|
|
public static class BrowserLauncher
|
|
{
|
|
/// <summary>
|
|
/// Opens the web client.
|
|
/// </summary>
|
|
/// <param name="appHost">The app host.</param>
|
|
public static void OpenWebApp(IServerApplicationHost appHost)
|
|
{
|
|
var url = appHost.GetLocalApiUrl("localhost") + "/web/index.html";
|
|
OpenUrl(appHost, url);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Opens the swagger API page.
|
|
/// </summary>
|
|
/// <param name="appHost">The app host.</param>
|
|
public static void OpenSwaggerPage(IServerApplicationHost appHost)
|
|
{
|
|
var url = appHost.GetLocalApiUrl("localhost") + "/swagger/index.html";
|
|
OpenUrl(appHost, url);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Opens the URL.
|
|
/// </summary>
|
|
/// <param name="appHost">The application host instance.</param>
|
|
/// <param name="url">The URL.</param>
|
|
private static void OpenUrl(IServerApplicationHost appHost, string url)
|
|
{
|
|
try
|
|
{
|
|
appHost.LaunchUrl(url);
|
|
}
|
|
catch (NotSupportedException)
|
|
{
|
|
|
|
}
|
|
catch (Exception)
|
|
{
|
|
}
|
|
}
|
|
}
|
|
}
|