mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-21 17:44:43 +01:00
moved a few things for mono
This commit is contained in:
@@ -3,9 +3,10 @@ using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.Plugins;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using System.ComponentModel;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Forms;
|
||||
using MediaBrowser.ServerApplication.Native;
|
||||
|
||||
namespace MediaBrowser.ServerApplication.EntryPoints
|
||||
{
|
||||
@@ -31,9 +32,10 @@ namespace MediaBrowser.ServerApplication.EntryPoints
|
||||
/// </summary>
|
||||
/// <param name="appHost">The app host.</param>
|
||||
/// <param name="userManager">The user manager.</param>
|
||||
public StartupWizard(IServerApplicationHost appHost, IUserManager userManager, IServerConfigurationManager configurationManager)
|
||||
public StartupWizard(IServerApplicationHost appHost, IUserManager userManager, IServerConfigurationManager configurationManager, ILogger logger)
|
||||
{
|
||||
_appHost = appHost;
|
||||
_logger = logger;
|
||||
_userManager = userManager;
|
||||
_configurationManager = configurationManager;
|
||||
}
|
||||
@@ -58,9 +60,9 @@ namespace MediaBrowser.ServerApplication.EntryPoints
|
||||
|
||||
try
|
||||
{
|
||||
App.OpenDashboardPage("wizardstart.html", user, _configurationManager, _appHost);
|
||||
BrowserLauncher.OpenDashboardPage("wizardstart.html", user, _configurationManager, _appHost, _logger);
|
||||
}
|
||||
catch (Win32Exception ex)
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error launching startup wizard", ex);
|
||||
|
||||
@@ -75,4 +77,4 @@ namespace MediaBrowser.ServerApplication.EntryPoints
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,95 +0,0 @@
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Controller.Plugins;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Server.Implementations.Udp;
|
||||
using System.Net.Sockets;
|
||||
|
||||
namespace MediaBrowser.ServerApplication.EntryPoints
|
||||
{
|
||||
/// <summary>
|
||||
/// Class UdpServerEntryPoint
|
||||
/// </summary>
|
||||
public class UdpServerEntryPoint : IServerEntryPoint
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the UDP server.
|
||||
/// </summary>
|
||||
/// <value>The UDP server.</value>
|
||||
private UdpServer UdpServer { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The _logger
|
||||
/// </summary>
|
||||
private readonly ILogger _logger;
|
||||
/// <summary>
|
||||
/// The _network manager
|
||||
/// </summary>
|
||||
private readonly INetworkManager _networkManager;
|
||||
/// <summary>
|
||||
/// The _server configuration manager
|
||||
/// </summary>
|
||||
private readonly IServerConfigurationManager _serverConfigurationManager;
|
||||
/// <summary>
|
||||
/// The _HTTP server
|
||||
/// </summary>
|
||||
private readonly IHttpServer _httpServer;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="UdpServerEntryPoint"/> class.
|
||||
/// </summary>
|
||||
/// <param name="logger">The logger.</param>
|
||||
/// <param name="networkManager">The network manager.</param>
|
||||
/// <param name="serverConfigurationManager">The server configuration manager.</param>
|
||||
/// <param name="httpServer">The HTTP server.</param>
|
||||
public UdpServerEntryPoint(ILogger logger, INetworkManager networkManager, IServerConfigurationManager serverConfigurationManager, IHttpServer httpServer)
|
||||
{
|
||||
_logger = logger;
|
||||
_networkManager = networkManager;
|
||||
_serverConfigurationManager = serverConfigurationManager;
|
||||
_httpServer = httpServer;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Runs this instance.
|
||||
/// </summary>
|
||||
public void Run()
|
||||
{
|
||||
var udpServer = new UdpServer(_logger, _networkManager, _serverConfigurationManager, _httpServer);
|
||||
|
||||
try
|
||||
{
|
||||
udpServer.Start(ApplicationHost.UdpServerPort);
|
||||
|
||||
UdpServer = udpServer;
|
||||
}
|
||||
catch (SocketException ex)
|
||||
{
|
||||
_logger.ErrorException("Failed to start UDP Server", ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Releases unmanaged and - optionally - managed resources.
|
||||
/// </summary>
|
||||
/// <param name="dispose"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
|
||||
protected virtual void Dispose(bool dispose)
|
||||
{
|
||||
if (dispose)
|
||||
{
|
||||
if (UdpServer != null)
|
||||
{
|
||||
UdpServer.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user