Remove ParsingLibrary

pull/5307/head
Qstick 4 years ago
parent 025f064ecf
commit 216f9b37b2

@ -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 @@ namespace NzbDrone.Core
{
public static string WithDefault(this string actual, object defaultValue)
{
#if !LIBRARY
Ensure.That(defaultValue, () => defaultValue).IsNotNull();
#endif
if (string.IsNullOrWhiteSpace(actual))
{
return defaultValue.ToString();

@ -241,9 +241,7 @@ namespace NzbDrone.Core.Parser
{
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 @@ namespace NzbDrone.Core.Parser
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;

@ -25,35 +25,5 @@ namespace NzbDrone.Core.Parser.Model
{
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
}
}

@ -7,8 +7,6 @@ using NLog;
using NzbDrone.Common.Extensions;
using NzbDrone.Common.Instrumentation;
using NzbDrone.Core.Parser.Model;
#if !LIBRARY
#endif
namespace NzbDrone.Core.Parser
{

@ -164,7 +164,7 @@ namespace NzbDrone.Core.Qualities
{
AllLookup[quality.Id] = quality;
}
#if !LIBRARY
DefaultQualityDefinitions = new HashSet<QualityDefinition>
{
new QualityDefinition(Quality.Unknown) { Weight = 1, MinSize = 0, MaxSize = 100, PreferredSize = 95 },
@ -203,15 +203,12 @@ namespace NzbDrone.Core.Qualities
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<Quality> All;
public static readonly Quality[] AllLookup;
#if !LIBRARY
public static readonly HashSet<QualityDefinition> DefaultQualityDefinitions;
#endif
public static Quality FindById(int id)
{
if (id == 0)

@ -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());
}
}
}

@ -1,95 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DefineConstants>TRACE;DEBUG;NETSTANDARD;NETSTANDARD2_0;LIBRARY;</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DefineConstants>TRACE;RELEASE;NETSTANDARD;NETSTANDARD2_0;LIBRARY</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\NzbDrone.Common\Exceptions\NzbDroneException.cs">
<Link>NzbDroneException.cs</Link>
</Compile>
<Compile Include="..\NzbDrone.Common\Extensions\DictionaryExtensions.cs">
<Link>DictionaryExtensions.cs</Link>
</Compile>
<Compile Include="..\NzbDrone.Common\Extensions\IEnumerableExtensions.cs">
<Link>IEnumerableExtensions.cs</Link>
</Compile>
<Compile Include="..\NzbDrone.Common\Extensions\Int64Extensions.cs">
<Link>Int64Extensions.cs</Link>
</Compile>
<Compile Include="..\NzbDrone.Common\Extensions\StringExtensions.cs">
<Link>StringExtensions.cs</Link>
</Compile>
<Compile Include="..\NzbDrone.Core\CustomFormats\CustomFormat.cs">
<Link>CustomFormat.cs</Link>
</Compile>
<Compile Include="..\NzbDrone.Core\CustomFormats\FormatTag.cs">
<Link>FormatTag.cs</Link>
</Compile>
<Compile Include="..\NzbDrone.Core\Datastore\IEmbeddedDocument.cs">
<Link>IEmbeddedDocument.cs</Link>
</Compile>
<Compile Include="..\NzbDrone.Core\Datastore\ModelBase.cs">
<Link>ModelBase.cs</Link>
</Compile>
<Compile Include="..\NzbDrone.Core\Fluent.cs">
<Link>Fluent.cs</Link>
</Compile>
<Compile Include="..\NzbDrone.Core\MediaFiles\MediaFileExtensions.cs">
<Link>MediaFileExtensions.cs</Link>
</Compile>
<Compile Include="..\NzbDrone.Core\Parser\InvalidDateException.cs">
<Link>InvalidDateException.cs</Link>
</Compile>
<Compile Include="..\NzbDrone.Core\Parser\IsoLanguage.cs">
<Link>IsoLanguage.cs</Link>
</Compile>
<Compile Include="..\NzbDrone.Core\Parser\IsoLanguages.cs">
<Link>IsoLanguages.cs</Link>
</Compile>
<Compile Include="..\NzbDrone.Core\Parser\Language.cs">
<Link>Language.cs</Link>
</Compile>
<Compile Include="..\NzbDrone.Core\Parser\LanguageParser.cs">
<Link>LanguageParser.cs</Link>
</Compile>
<Compile Include="..\NzbDrone.Core\Parser\Model\ParsedMovieInfo.cs">
<Link>ParsedMovieInfo.cs</Link>
</Compile>
<Compile Include="..\NzbDrone.Core\Parser\Parser.cs">
<Link>Parser.cs</Link>
</Compile>
<Compile Include="..\NzbDrone.Core\Parser\QualityParser.cs">
<Link>QualityParser.cs</Link>
</Compile>
<Compile Include="..\NzbDrone.Core\Parser\SceneChecker.cs">
<Link>SceneChecker.cs</Link>
</Compile>
<Compile Include="..\NzbDrone.Core\Qualities\Quality.cs">
<Link>Quality.cs</Link>
</Compile>
<Compile Include="..\NzbDrone.Core\Qualities\QualityModel.cs">
<Link>QualityModel.cs</Link>
</Compile>
<Compile Include="..\NzbDrone.Core\Qualities\QualitySource.cs">
<Link>QualitySource.cs</Link>
</Compile>
<Compile Include="..\NzbDrone.Core\Qualities\Revision.cs">
<Link>Revision.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="NLog" Version="4.5.11" />
</ItemGroup>
</Project>

@ -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;
}
}
}
Loading…
Cancel
Save