mirror of
https://github.com/Sonarr/Sonarr
synced 2025-01-02 13:14:58 +00:00
minor cleanup
This commit is contained in:
parent
6af9b03d26
commit
3b087ba922
3 changed files with 8 additions and 11 deletions
|
@ -5,8 +5,8 @@ namespace NzbDrone.Common.Processes
|
||||||
{
|
{
|
||||||
public class ProcessOutput
|
public class ProcessOutput
|
||||||
{
|
{
|
||||||
public List<String> Standard { get; set; }
|
public List<String> Standard { get; private set; }
|
||||||
public List<String> Error { get; set; }
|
public List<String> Error { get; private set; }
|
||||||
|
|
||||||
public ProcessOutput()
|
public ProcessOutput()
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.Linq;
|
||||||
using NetFwTypeLib;
|
using NetFwTypeLib;
|
||||||
using NLog;
|
using NLog;
|
||||||
using NzbDrone.Common.EnvironmentInfo;
|
using NzbDrone.Common.EnvironmentInfo;
|
||||||
|
@ -14,10 +15,10 @@ namespace NzbDrone.Host.AccessControl
|
||||||
public class FirewallAdapter : IFirewallAdapter
|
public class FirewallAdapter : IFirewallAdapter
|
||||||
{
|
{
|
||||||
private const NET_FW_PROFILE_TYPE_ FIREWALL_PROFILE = NET_FW_PROFILE_TYPE_.NET_FW_PROFILE_STANDARD;
|
private const NET_FW_PROFILE_TYPE_ FIREWALL_PROFILE = NET_FW_PROFILE_TYPE_.NET_FW_PROFILE_STANDARD;
|
||||||
|
|
||||||
private readonly IConfigFileProvider _configFileProvider;
|
private readonly IConfigFileProvider _configFileProvider;
|
||||||
private readonly Logger _logger;
|
private readonly Logger _logger;
|
||||||
|
|
||||||
public FirewallAdapter(IConfigFileProvider configFileProvider, Logger logger)
|
public FirewallAdapter(IConfigFileProvider configFileProvider, Logger logger)
|
||||||
{
|
{
|
||||||
_configFileProvider = configFileProvider;
|
_configFileProvider = configFileProvider;
|
||||||
|
@ -51,11 +52,7 @@ namespace NzbDrone.Host.AccessControl
|
||||||
var mgr = (INetFwMgr)Activator.CreateInstance(netFwMgrType);
|
var mgr = (INetFwMgr)Activator.CreateInstance(netFwMgrType);
|
||||||
var ports = mgr.LocalPolicy.GetProfileByType(FIREWALL_PROFILE).GloballyOpenPorts;
|
var ports = mgr.LocalPolicy.GetProfileByType(FIREWALL_PROFILE).GloballyOpenPorts;
|
||||||
|
|
||||||
foreach (INetFwOpenPort p in ports)
|
return ports.Cast<INetFwOpenPort>().Any(p => p.Port == port);
|
||||||
{
|
|
||||||
if (p.Port == port)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
|
@ -6,11 +6,11 @@ namespace NzbDrone.Host.Owin
|
||||||
{
|
{
|
||||||
public class OwinTraceOutputFactory : ITraceOutputFactory
|
public class OwinTraceOutputFactory : ITraceOutputFactory
|
||||||
{
|
{
|
||||||
private readonly Logger logger = LogManager.GetLogger("Owin");
|
private readonly Logger _logger = LogManager.GetLogger("Owin");
|
||||||
|
|
||||||
public TextWriter Create(string outputFile)
|
public TextWriter Create(string outputFile)
|
||||||
{
|
{
|
||||||
return new NlogTextWriter(logger);
|
return new NlogTextWriter(_logger);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue