diff --git a/src/NzbDrone.Core/Fluent.cs b/src/NzbDrone.Core/Fluent.cs index 02f993f4e..cc507b242 100644 --- a/src/NzbDrone.Core/Fluent.cs +++ b/src/NzbDrone.Core/Fluent.cs @@ -2,9 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -#if !LIBRARY using NzbDrone.Common.EnsureThat; -#endif namespace NzbDrone.Core { @@ -12,9 +10,8 @@ public static class Fluent { public static string WithDefault(this string actual, object defaultValue) { -#if !LIBRARY Ensure.That(defaultValue, () => defaultValue).IsNotNull(); -#endif + if (string.IsNullOrWhiteSpace(actual)) { return defaultValue.ToString(); diff --git a/src/NzbDrone.Core/Parser/LanguageParser.cs b/src/NzbDrone.Core/Parser/LanguageParser.cs index e7c262fc8..5620aba31 100644 --- a/src/NzbDrone.Core/Parser/LanguageParser.cs +++ b/src/NzbDrone.Core/Parser/LanguageParser.cs @@ -241,9 +241,7 @@ public static Language ParseSubtitleLanguage(string fileName) { try { -#if !LIBRARY Logger.Debug("Parsing language from subtitle file: {0}", fileName); -#endif var simpleFilename = Path.GetFileNameWithoutExtension(fileName); var languageMatch = SubtitleLanguageRegex.Match(simpleFilename); @@ -255,15 +253,12 @@ public static Language ParseSubtitleLanguage(string fileName) return isoLanguage?.Language ?? Language.Unknown; } -#if !LIBRARY + Logger.Debug("Unable to parse langauge from subtitle file: {0}", fileName); -#endif } catch (Exception) { -#if !LIBRARY Logger.Debug("Failed parsing langauge from subtitle file: {0}", fileName); -#endif } return Language.Unknown; diff --git a/src/NzbDrone.Core/Parser/Model/ParsedMovieInfo.cs b/src/NzbDrone.Core/Parser/Model/ParsedMovieInfo.cs index 935a9d78f..b7d9f3120 100644 --- a/src/NzbDrone.Core/Parser/Model/ParsedMovieInfo.cs +++ b/src/NzbDrone.Core/Parser/Model/ParsedMovieInfo.cs @@ -25,35 +25,5 @@ public override string ToString() { return string.Format("{0} - {1} {2}", MovieTitle, Year, Quality); } - -#if LIBRARY - public static ParsedMovieInfo ParseMovieInfo(string title) - { - var parsedMovie = Parser.ParseMovieTitle(title, false); - - if (parsedMovie == null) return null; - - parsedMovie.Languages = LanguageParser.ParseLanguages(parsedMovie.SimpleReleaseTitle); - - parsedMovie.Quality = QualityParser.ParseQuality(parsedMovie.SimpleReleaseTitle); - - if (parsedMovie.Edition.IsNullOrWhiteSpace()) - { - parsedMovie.Edition = Parser.ParseEdition(parsedMovie.SimpleReleaseTitle); - } - - parsedMovie.ReleaseGroup = Parser.ParseReleaseGroup(parsedMovie.SimpleReleaseTitle); - - parsedMovie.ImdbId = Parser.ParseImdbId(parsedMovie.SimpleReleaseTitle); - - parsedMovie.Languages = - LanguageParser.EnhanceLanguages(parsedMovie.SimpleReleaseTitle, parsedMovie.Languages); - - parsedMovie.Quality.Quality = Qualities.Quality.FindByInfo(parsedMovie.Quality.Source, parsedMovie.Quality.Resolution, - parsedMovie.Quality.Modifier); - - return parsedMovie; - } -#endif } } diff --git a/src/NzbDrone.Core/Parser/Parser.cs b/src/NzbDrone.Core/Parser/Parser.cs index 3dd198a24..077bee98f 100644 --- a/src/NzbDrone.Core/Parser/Parser.cs +++ b/src/NzbDrone.Core/Parser/Parser.cs @@ -7,8 +7,6 @@ using NzbDrone.Common.Extensions; using NzbDrone.Common.Instrumentation; using NzbDrone.Core.Parser.Model; -#if !LIBRARY -#endif namespace NzbDrone.Core.Parser { diff --git a/src/NzbDrone.Core/Qualities/Quality.cs b/src/NzbDrone.Core/Qualities/Quality.cs index 2bb812a9e..0ac874a4c 100644 --- a/src/NzbDrone.Core/Qualities/Quality.cs +++ b/src/NzbDrone.Core/Qualities/Quality.cs @@ -164,7 +164,7 @@ static Quality() { AllLookup[quality.Id] = quality; } -#if !LIBRARY + DefaultQualityDefinitions = new HashSet { new QualityDefinition(Quality.Unknown) { Weight = 1, MinSize = 0, MaxSize = 100, PreferredSize = 95 }, @@ -203,15 +203,12 @@ static Quality() new QualityDefinition(Quality.BRDISK) { Weight = 25, MinSize = 0, MaxSize = null, PreferredSize = null }, new QualityDefinition(Quality.RAWHD) { Weight = 26, MinSize = 0, MaxSize = null, PreferredSize = null } }; -#endif } public static readonly List All; public static readonly Quality[] AllLookup; -#if !LIBRARY public static readonly HashSet DefaultQualityDefinitions; -#endif public static Quality FindById(int id) { if (id == 0) diff --git a/src/ParsingLibrary/NzbDroneLogger.cs b/src/ParsingLibrary/NzbDroneLogger.cs deleted file mode 100644 index 3e132ab65..000000000 --- a/src/ParsingLibrary/NzbDroneLogger.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; - -namespace NzbDrone.Common.Instrumentation -{ - public static class NzbDroneLogger - { - public static Logger GetLogger(Type type) - { - return LogManager.GetLogger(type.Name.Replace("NzbDrone.", "")); - } - - public static Logger GetLogger(object obj) - { - return GetLogger(obj.GetType()); - } - } -} diff --git a/src/ParsingLibrary/ParsingLibrary.csproj b/src/ParsingLibrary/ParsingLibrary.csproj deleted file mode 100644 index 9f4636f15..000000000 --- a/src/ParsingLibrary/ParsingLibrary.csproj +++ /dev/null @@ -1,95 +0,0 @@ - - - - netstandard2.0 - - - - TRACE;DEBUG;NETSTANDARD;NETSTANDARD2_0;LIBRARY; - - - - TRACE;RELEASE;NETSTANDARD;NETSTANDARD2_0;LIBRARY - - - - - NzbDroneException.cs - - - DictionaryExtensions.cs - - - IEnumerableExtensions.cs - - - Int64Extensions.cs - - - StringExtensions.cs - - - CustomFormat.cs - - - FormatTag.cs - - - IEmbeddedDocument.cs - - - ModelBase.cs - - - Fluent.cs - - - MediaFileExtensions.cs - - - InvalidDateException.cs - - - IsoLanguage.cs - - - IsoLanguages.cs - - - Language.cs - - - LanguageParser.cs - - - ParsedMovieInfo.cs - - - Parser.cs - - - QualityParser.cs - - - SceneChecker.cs - - - Quality.cs - - - QualityModel.cs - - - QualitySource.cs - - - Revision.cs - - - - - - - - - diff --git a/src/ParsingLibrary/PathExtensions.cs b/src/ParsingLibrary/PathExtensions.cs deleted file mode 100644 index e7163dceb..000000000 --- a/src/ParsingLibrary/PathExtensions.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.IO; - -namespace NzbDrone.Common.Extensions -{ - public static class PathExtensions - { - public static bool ContainsInvalidPathChars(this string text) - { - return text.IndexOfAny(Path.GetInvalidPathChars()) >= 0; - } - } -}