From 5fb1f4902f5a7f0799b861698766613ce0914be9 Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Sat, 19 Jan 2013 17:00:20 -0800 Subject: [PATCH] fixed /api . responds with profiles. --- NzbDrone.Api/Bootstrapper.cs | 7 ++++++- NzbDrone.Core/Datastore/ConnectionFactory.cs | 5 +++++ NzbDrone.Web/App_Start/Logging.cs | 4 +--- NzbDrone.Web/Web.config | 1 - 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/NzbDrone.Api/Bootstrapper.cs b/NzbDrone.Api/Bootstrapper.cs index c4fda1b98..6b0b9dcc6 100644 --- a/NzbDrone.Api/Bootstrapper.cs +++ b/NzbDrone.Api/Bootstrapper.cs @@ -23,7 +23,12 @@ namespace NzbDrone.Api _logger = LogManager.GetCurrentClassLogger(); } - public static void Initialize() + protected override void ApplicationStartup(ILifetimeScope container, IPipelines pipelines) + { + InitializeAutomapper(); + } + + public static void InitializeAutomapper() { //QualityProfiles Mapper.CreateMap() diff --git a/NzbDrone.Core/Datastore/ConnectionFactory.cs b/NzbDrone.Core/Datastore/ConnectionFactory.cs index 7c03e4933..39186f167 100644 --- a/NzbDrone.Core/Datastore/ConnectionFactory.cs +++ b/NzbDrone.Core/Datastore/ConnectionFactory.cs @@ -131,6 +131,11 @@ namespace NzbDrone.Core.Datastore } catch (SqlCeException e) { + if (e.Message.Contains("file sharing violation")) + { + logger.WarnException("file is in use. skipping.", e); + return; + } logger.WarnException( "Safe recovery failed. will attempts a more aggressive strategy. might case loss of data.", e); diff --git a/NzbDrone.Web/App_Start/Logging.cs b/NzbDrone.Web/App_Start/Logging.cs index 7a53a6b51..86f0f5126 100644 --- a/NzbDrone.Web/App_Start/Logging.cs +++ b/NzbDrone.Web/App_Start/Logging.cs @@ -1,7 +1,5 @@ -using System.IO; using System.Linq; using NLog; -using NLog.Config; using NzbDrone.Common; [assembly: WebActivator.PreApplicationStartMethod(typeof(NzbDrone.Web.App_Start.Logging), "PreStart")] @@ -15,7 +13,7 @@ namespace NzbDrone.Web.App_Start { var environmentProvider = new EnvironmentProvider(); - LogManager.Configuration = new XmlLoggingConfiguration(environmentProvider.GetNlogConfigPath(), false); + //LogManager.Configuration = new XmlLoggingConfiguration(environmentProvider.GetNlogConfigPath(), false); LogConfiguration.RegisterUdpLogger(); LogConfiguration.RegisterRemote(); diff --git a/NzbDrone.Web/Web.config b/NzbDrone.Web/Web.config index f4fbd3b20..93d9c7516 100644 --- a/NzbDrone.Web/Web.config +++ b/NzbDrone.Web/Web.config @@ -41,7 +41,6 @@ -