diff --git a/NzbDrone.Common/EnsureThat/StringExtensions.cs b/NzbDrone.Common/EnsureThat/StringExtensions.cs deleted file mode 100644 index 1f16b30ab..000000000 --- a/NzbDrone.Common/EnsureThat/StringExtensions.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.Text.RegularExpressions; -using System.Linq; - -namespace NzbDrone.Common.EnsureThat -{ - public static class StringExtensions - { - public static string Inject(this string format, params object[] formattingArgs) - { - return string.Format(format, formattingArgs); - } - - public static string Inject(this string format, params string[] formattingArgs) - { - return string.Format(format, formattingArgs.Cast()); - } - - - private static readonly Regex InvalidCharRegex = new Regex(@"[^a-z0-9\s-]", RegexOptions.Compiled | RegexOptions.IgnoreCase); - private static readonly Regex CollapseSpace = new Regex(@"\s+", RegexOptions.Compiled | RegexOptions.IgnoreCase); - - public static string ToSlug(this string phrase) - { - phrase = phrase.RemoveAccent().ToLower(); - - phrase = InvalidCharRegex.Replace(phrase, string.Empty); - phrase = CollapseSpace.Replace(phrase, " ").Trim(); - phrase = phrase.Replace(" ", "-"); - - return phrase; - } - - public static string RemoveAccent(this string txt) - { - var bytes = System.Text.Encoding.GetEncoding("Cyrillic").GetBytes(txt); - return System.Text.Encoding.ASCII.GetString(bytes); - } - } -} \ No newline at end of file diff --git a/NzbDrone.Common/Instrumentation/LogglyTarget.cs b/NzbDrone.Common/Instrumentation/LogglyTarget.cs index 047940c89..e43754454 100644 --- a/NzbDrone.Common/Instrumentation/LogglyTarget.cs +++ b/NzbDrone.Common/Instrumentation/LogglyTarget.cs @@ -56,6 +56,11 @@ namespace NzbDrone.Common.Instrumentation dictionary.Add("ex", logEvent.Exception.ToString()); dictionary.Add("extyp", logEvent.Exception.GetType().Name); dictionary.Add("hash", logEvent.GetHash()); + + foreach (var key in logEvent.Exception.Data.Keys) + { + dictionary.Add(key.ToString(), logEvent.Exception.Data[key]); + } } dictionary.Add("logger", logEvent.LoggerName); diff --git a/NzbDrone.Core/DecisionEngine/DownloadDecisionMaker.cs b/NzbDrone.Core/DecisionEngine/DownloadDecisionMaker.cs index eaac8b7ab..4ce0d790f 100644 --- a/NzbDrone.Core/DecisionEngine/DownloadDecisionMaker.cs +++ b/NzbDrone.Core/DecisionEngine/DownloadDecisionMaker.cs @@ -110,6 +110,8 @@ namespace NzbDrone.Core.DecisionEngine } catch (Exception e) { + e.Data.Add("report", remoteEpisode.Report); + e.Data.Add("parsed", remoteEpisode.ParsedEpisodeInfo); _logger.ErrorException("Couldn't evaluate decision", e); return string.Format("{0}: {1}", spec.GetType().Name, e.Message); } diff --git a/NzbDrone.Core/DecisionEngine/Specifications/AcceptableSizeSpecification.cs b/NzbDrone.Core/DecisionEngine/Specifications/AcceptableSizeSpecification.cs index 08f7c4709..7184e9efc 100644 --- a/NzbDrone.Core/DecisionEngine/Specifications/AcceptableSizeSpecification.cs +++ b/NzbDrone.Core/DecisionEngine/Specifications/AcceptableSizeSpecification.cs @@ -1,7 +1,5 @@ using System.Linq; using NLog; -using NzbDrone.Core.Model; -using NzbDrone.Core.Parser; using NzbDrone.Core.Parser.Model; using NzbDrone.Core.Qualities; using NzbDrone.Core.Tv; diff --git a/NzbDrone.Core/MetadataSource/TraktProxy.cs b/NzbDrone.Core/MetadataSource/TraktProxy.cs index 38d956ce6..b90de4fb2 100644 --- a/NzbDrone.Core/MetadataSource/TraktProxy.cs +++ b/NzbDrone.Core/MetadataSource/TraktProxy.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; +using NzbDrone.Common; using NzbDrone.Core.MediaCover; using NzbDrone.Core.MetadataSource.Trakt; using NzbDrone.Core.Tv;