mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-11 12:02:35 +02:00
Added udp logging Added SyncProvider to provide async long running tasks Refactored SyncSeries to SyncProvider Episode Info is now fetched automatically Optimized RefreshEpisodeInfo for better performance
46 lines
1.2 KiB
C#
46 lines
1.2 KiB
C#
using System;
|
|
using System.Configuration;
|
|
using System.IO;
|
|
using System.Reflection;
|
|
using NLog;
|
|
using NLog.Config;
|
|
|
|
namespace NzbDrone
|
|
{
|
|
class Config
|
|
{
|
|
private static string _projectRoot = string.Empty;
|
|
internal static string ProjectRoot
|
|
{
|
|
get
|
|
{
|
|
if (string.IsNullOrEmpty(_projectRoot))
|
|
{
|
|
var appDir = new FileInfo(Assembly.GetExecutingAssembly().Location).Directory;
|
|
|
|
while (appDir.GetDirectories("iisexpress").Length == 0)
|
|
{
|
|
if (appDir.Parent == null) throw new ApplicationException("Can't fine IISExpress folder.");
|
|
appDir = appDir.Parent;
|
|
}
|
|
|
|
_projectRoot = appDir.FullName;
|
|
}
|
|
|
|
return _projectRoot;
|
|
}
|
|
}
|
|
|
|
internal static void ConfigureNlog()
|
|
{
|
|
LogManager.Configuration = new XmlLoggingConfiguration(Path.Combine(ProjectRoot, "NZBDrone.Web\\log.config"), false);
|
|
}
|
|
|
|
internal static int Port
|
|
{
|
|
get { return Convert.ToInt32(ConfigurationManager.AppSettings.Get("port")); }
|
|
}
|
|
|
|
}
|
|
}
|