|
|
@ -1,8 +1,6 @@
|
|
|
|
using System;
|
|
|
|
using System.ServiceProcess;
|
|
|
|
using System.ServiceProcess;
|
|
|
|
|
|
|
|
using NLog;
|
|
|
|
using NLog;
|
|
|
|
using NzbDrone.Common.EnvironmentInfo;
|
|
|
|
using NzbDrone.Common.EnvironmentInfo;
|
|
|
|
using NzbDrone.Common.Processes;
|
|
|
|
|
|
|
|
using NzbDrone.Core.Configuration;
|
|
|
|
using NzbDrone.Core.Configuration;
|
|
|
|
using NzbDrone.Host.Owin;
|
|
|
|
using NzbDrone.Host.Owin;
|
|
|
|
|
|
|
|
|
|
|
@ -20,20 +18,20 @@ namespace NzbDrone.Host
|
|
|
|
private readonly IConfigFileProvider _configFileProvider;
|
|
|
|
private readonly IConfigFileProvider _configFileProvider;
|
|
|
|
private readonly IRuntimeInfo _runtimeInfo;
|
|
|
|
private readonly IRuntimeInfo _runtimeInfo;
|
|
|
|
private readonly IHostController _hostController;
|
|
|
|
private readonly IHostController _hostController;
|
|
|
|
private readonly IProcessProvider _processProvider;
|
|
|
|
|
|
|
|
private readonly PriorityMonitor _priorityMonitor;
|
|
|
|
private readonly PriorityMonitor _priorityMonitor;
|
|
|
|
private readonly IStartupArguments _startupArguments;
|
|
|
|
private readonly IStartupArguments _startupArguments;
|
|
|
|
|
|
|
|
private readonly IBrowserService _browserService;
|
|
|
|
private readonly Logger _logger;
|
|
|
|
private readonly Logger _logger;
|
|
|
|
|
|
|
|
|
|
|
|
public NzbDroneServiceFactory(IConfigFileProvider configFileProvider, IHostController hostController, IRuntimeInfo runtimeInfo,
|
|
|
|
public NzbDroneServiceFactory(IConfigFileProvider configFileProvider, IHostController hostController,
|
|
|
|
IProcessProvider processProvider, PriorityMonitor priorityMonitor, IStartupArguments startupArguments, Logger logger)
|
|
|
|
IRuntimeInfo runtimeInfo, PriorityMonitor priorityMonitor, IStartupArguments startupArguments, IBrowserService browserService, Logger logger)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_configFileProvider = configFileProvider;
|
|
|
|
_configFileProvider = configFileProvider;
|
|
|
|
_hostController = hostController;
|
|
|
|
_hostController = hostController;
|
|
|
|
_runtimeInfo = runtimeInfo;
|
|
|
|
_runtimeInfo = runtimeInfo;
|
|
|
|
_processProvider = processProvider;
|
|
|
|
|
|
|
|
_priorityMonitor = priorityMonitor;
|
|
|
|
_priorityMonitor = priorityMonitor;
|
|
|
|
_startupArguments = startupArguments;
|
|
|
|
_startupArguments = startupArguments;
|
|
|
|
|
|
|
|
_browserService = browserService;
|
|
|
|
_logger = logger;
|
|
|
|
_logger = logger;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -50,15 +48,7 @@ namespace NzbDrone.Host
|
|
|
|
_runtimeInfo.IsUserInteractive &&
|
|
|
|
_runtimeInfo.IsUserInteractive &&
|
|
|
|
_configFileProvider.LaunchBrowser)
|
|
|
|
_configFileProvider.LaunchBrowser)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
try
|
|
|
|
_browserService.LaunchWebUI();
|
|
|
|
{
|
|
|
|
|
|
|
|
_logger.Info("Starting default browser. {0}", _hostController.AppUrl);
|
|
|
|
|
|
|
|
_processProvider.OpenDefaultBrowser(_hostController.AppUrl);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_logger.ErrorException("Failed to open URL in default browser.", e);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
_priorityMonitor.Start();
|
|
|
|
_priorityMonitor.Start();
|
|
|
|