mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-10 11:10:40 +02:00
273de41d23
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
67 lines
1.9 KiB
C#
67 lines
1.9 KiB
C#
using System;
|
|
using System.Diagnostics;
|
|
using System.Threading;
|
|
using System.Web;
|
|
using System.Web.Mvc;
|
|
using System.Web.Routing;
|
|
using Ninject;
|
|
using Ninject.Web.Mvc;
|
|
using NLog;
|
|
using NzbDrone.Core;
|
|
|
|
namespace NzbDrone.Web
|
|
{
|
|
public class MvcApplication : NinjectHttpApplication
|
|
{
|
|
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
|
|
|
public static void RegisterRoutes(RouteCollection routes)
|
|
{
|
|
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
|
|
routes.IgnoreRoute("{*robotstxt}", new { robotstxt = @"(.*/)?robots.txt(/.*)?" });
|
|
routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" });
|
|
|
|
routes.MapRoute(
|
|
"Default", // Route name
|
|
"{controller}/{action}/{id}", // URL with parameters
|
|
new { controller = "Series", action = "Index", id = UrlParameter.Optional } // Parameter defaults
|
|
);
|
|
}
|
|
|
|
protected override void OnApplicationStarted()
|
|
{
|
|
Instrumentation.Setup();
|
|
CentralDispatch.DedicateToHost();
|
|
AreaRegistration.RegisterAllAreas();
|
|
RegisterRoutes(RouteTable.Routes);
|
|
base.OnApplicationStarted();
|
|
}
|
|
|
|
protected override IKernel CreateKernel()
|
|
{
|
|
return CentralDispatch.NinjectKernel;
|
|
}
|
|
|
|
// ReSharper disable InconsistentNaming
|
|
protected void Application_Error(object sender, EventArgs e)
|
|
{
|
|
var lastError = Server.GetLastError();
|
|
if (lastError is HttpException)
|
|
{
|
|
Logger.WarnException("", lastError);
|
|
}
|
|
else
|
|
{
|
|
Logger.FatalException("", lastError);
|
|
}
|
|
}
|
|
|
|
protected void Application_BeginRequest()
|
|
{
|
|
Thread.CurrentThread.Name = "UI";
|
|
}
|
|
|
|
|
|
|
|
}
|
|
} |