mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 21:43:33 -07: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:
parent
41d9b0364f
commit
c8a8fb4d62
57 changed files with 5569 additions and 320 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue