mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-25 10:07:15 +01:00
update browser launcher
This commit is contained in:
@@ -317,7 +317,7 @@ namespace MediaBrowser.ServerApplication
|
||||
{
|
||||
if (e.Reason == SessionSwitchReason.SessionLogon)
|
||||
{
|
||||
BrowserLauncher.OpenDashboard(_appHost, _logger);
|
||||
BrowserLauncher.OpenDashboard(_appHost);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
using MediaBrowser.Common.Net;
|
||||
using System;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Server.Startup.Common;
|
||||
using MediaBrowser.ServerApplication.Networking;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using CommonIO;
|
||||
using MediaBrowser.Controller.Power;
|
||||
using MediaBrowser.Server.Startup.Common.FFMpeg;
|
||||
using OperatingSystem = MediaBrowser.Server.Startup.Common.OperatingSystem;
|
||||
|
||||
namespace MediaBrowser.ServerApplication.Native
|
||||
{
|
||||
@@ -156,6 +159,42 @@ namespace MediaBrowser.ServerApplication.Native
|
||||
return info;
|
||||
}
|
||||
|
||||
public void LaunchUrl(string url)
|
||||
{
|
||||
var process = new Process
|
||||
{
|
||||
StartInfo = new ProcessStartInfo
|
||||
{
|
||||
FileName = url
|
||||
},
|
||||
|
||||
EnableRaisingEvents = true,
|
||||
};
|
||||
|
||||
process.Exited += ProcessExited;
|
||||
|
||||
try
|
||||
{
|
||||
process.Start();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error launching url: {0}", ex, url);
|
||||
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Processes the exited.
|
||||
/// </summary>
|
||||
/// <param name="sender">The sender.</param>
|
||||
/// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
|
||||
private static void ProcessExited(object sender, EventArgs e)
|
||||
{
|
||||
((Process)sender).Dispose();
|
||||
}
|
||||
|
||||
private string[] GetDownloadUrls()
|
||||
{
|
||||
switch (Environment.SystemArchitecture)
|
||||
|
||||
@@ -163,7 +163,7 @@ namespace MediaBrowser.ServerApplication
|
||||
|
||||
void notifyIcon1_DoubleClick(object sender, EventArgs e)
|
||||
{
|
||||
BrowserLauncher.OpenDashboard(_appHost, _logger);
|
||||
BrowserLauncher.OpenDashboard(_appHost);
|
||||
}
|
||||
|
||||
private void LocalizeText()
|
||||
@@ -194,17 +194,17 @@ namespace MediaBrowser.ServerApplication
|
||||
|
||||
void cmdBrowse_Click(object sender, EventArgs e)
|
||||
{
|
||||
BrowserLauncher.OpenWebClient(_appHost, _logger);
|
||||
BrowserLauncher.OpenWebClient(_appHost);
|
||||
}
|
||||
|
||||
void cmdCommunity_Click(object sender, EventArgs e)
|
||||
{
|
||||
BrowserLauncher.OpenCommunity(_logger);
|
||||
BrowserLauncher.OpenCommunity(_appHost);
|
||||
}
|
||||
|
||||
void cmdConfigure_Click(object sender, EventArgs e)
|
||||
{
|
||||
BrowserLauncher.OpenDashboard(_appHost, _logger);
|
||||
BrowserLauncher.OpenDashboard(_appHost);
|
||||
}
|
||||
|
||||
void cmdRestart_Click(object sender, EventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user