You've already forked Sonarr
mirror of
https://github.com/Sonarr/Sonarr.git
synced 2025-11-06 09:19:38 +02:00
Fixed notification issues
Added basic support for file scan Major redactor of ReportTitle/File parsing Updated Ninject/Ninject.MVC Removed dependency from Microsoft.Web.Administration reactored Episode repository structure
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Microsoft.Web.Administration;
|
||||
using System.Xml.Linq;
|
||||
using System.Xml.XPath;
|
||||
using NLog;
|
||||
|
||||
namespace NzbDrone
|
||||
@@ -46,7 +45,16 @@ namespace NzbDrone
|
||||
|
||||
//Set Variables for the config file.
|
||||
Environment.SetEnvironmentVariable("NZBDRONE_PATH", Config.ProjectRoot);
|
||||
UpdateIISConfig();
|
||||
|
||||
try
|
||||
{
|
||||
UpdateIISConfig();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.Error("An error has occured while trying to update the config file.", e);
|
||||
}
|
||||
|
||||
|
||||
Logger.Info("Starting process. [{0}]", IISProcess.StartInfo.FileName);
|
||||
IISProcess.Start();
|
||||
@@ -101,10 +109,22 @@ namespace NzbDrone
|
||||
|
||||
private static void UpdateIISConfig()
|
||||
{
|
||||
string configPath = Path.Combine(IISFolder, @"AppServer\applicationhost.config");
|
||||
|
||||
Logger.Info(@"Server configuration file: {0}", configPath);
|
||||
Logger.Info(@"Configuring server to: [http://localhost:{0}]", Config.Port);
|
||||
var serverManager = new ServerManager(Path.Combine(IISFolder, @"AppServer\applicationhost.config"));
|
||||
serverManager.Sites["NZBDrone"].Bindings[0].BindingInformation = string.Format("*:{0}:", Config.Port);
|
||||
serverManager.CommitChanges();
|
||||
|
||||
var configXml = XDocument.Load(configPath);
|
||||
|
||||
var bindings = configXml.XPathSelectElement("configuration/system.applicationHost/sites").Elements("site").Where(d => d.Attribute("name").Value.ToLowerInvariant() == "nzbdrone").First().Element("bindings");
|
||||
bindings.Descendants().Remove();
|
||||
bindings.Add(
|
||||
new XElement("binding",
|
||||
new XAttribute("protocol", "http"),
|
||||
new XAttribute("bindingInformation", String.Format("*:{0}:", Config.Port))
|
||||
));
|
||||
|
||||
configXml.Save(configPath);
|
||||
}
|
||||
|
||||
private static string CleanPath(string path)
|
||||
|
||||
@@ -50,6 +50,9 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Accessibility">
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</Reference>
|
||||
<Reference Include="EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</Reference>
|
||||
@@ -60,9 +63,6 @@
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\NzbDrone.Core\Libraries\Exceptioneer.WindowsFormsClient.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Web.Administration, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="NLog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\NzbDrone.Core\Libraries\NLog.dll</HintPath>
|
||||
|
||||
@@ -4,6 +4,6 @@
|
||||
<supportedRuntime version="v4.0" />
|
||||
</startup>
|
||||
<appSettings>
|
||||
<add key="port" value="8981" />
|
||||
<add key="port" value="8989" />
|
||||
</appSettings>
|
||||
</configuration>
|
||||
Reference in New Issue
Block a user