* Stylecop Rules and Fixes
This commit is contained in:
Qstick
2020-01-03 07:49:24 -05:00
committed by GitHub
parent 63d669178d
commit f77a2feeef
1307 changed files with 8704 additions and 7404 deletions
+16 -13
View File
@@ -8,7 +8,6 @@ using NzbDrone.Common.Http;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Indexers.Newznab;
using NzbDrone.Core.Parser;
using NzbDrone.Core.ThingiProvider;
using NzbDrone.Core.Validation;
namespace NzbDrone.Core.Indexers.Torznab
@@ -45,17 +44,17 @@ namespace NzbDrone.Core.Indexers.Torznab
private IndexerDefinition GetDefinition(string name, TorznabSettings settings)
{
return new IndexerDefinition
{
EnableRss = false,
EnableAutomaticSearch = false,
EnableInteractiveSearch = false,
Name = name,
Implementation = GetType().Name,
Settings = settings,
Protocol = DownloadProtocol.Usenet,
SupportsRss = SupportsRss,
SupportsSearch = SupportsSearch
};
{
EnableRss = false,
EnableAutomaticSearch = false,
EnableInteractiveSearch = false,
Name = name,
Implementation = GetType().Name,
Settings = settings,
Protocol = DownloadProtocol.Usenet,
SupportsRss = SupportsRss,
SupportsSearch = SupportsSearch
};
}
private TorznabSettings GetSettings(string url, params int[] categories)
@@ -73,7 +72,11 @@ namespace NzbDrone.Core.Indexers.Torznab
protected override void Test(List<ValidationFailure> failures)
{
base.Test(failures);
if (failures.HasErrors()) return;
if (failures.HasErrors())
{
return;
}
failures.AddIfNotNull(TestCapabilities());
}
@@ -4,11 +4,13 @@ namespace NzbDrone.Core.Indexers.Torznab
{
public class TorznabException : NzbDroneException
{
public TorznabException(string message, params object[] args) : base(message, args)
public TorznabException(string message, params object[] args)
: base(message, args)
{
}
public TorznabException(string message) : base(message)
public TorznabException(string message)
: base(message)
{
}
}
@@ -22,12 +22,18 @@ namespace NzbDrone.Core.Indexers.Torznab
var xdoc = LoadXmlDocument(indexerResponse);
var error = xdoc.Descendants("error").FirstOrDefault();
if (error == null) return true;
if (error == null)
{
return true;
}
var code = Convert.ToInt32(error.Attribute("code").Value);
var errorMessage = error.Attribute("description").Value;
if (code >= 100 && code <= 199) throw new ApiKeyException("Invalid API key");
if (code >= 100 && code <= 199)
{
throw new ApiKeyException("Invalid API key");
}
if (!indexerResponse.Request.Url.FullUri.Contains("apikey=") && errorMessage == "Missing parameter")
{
@@ -60,7 +66,6 @@ namespace NzbDrone.Core.Indexers.Torznab
return true;
}
protected override string GetInfoUrl(XElement item)
{
return ParseUrl(item.TryGetValue("comments").TrimEnd("#comments"));
@@ -1,7 +1,6 @@
using System.Linq;
using System.Text.RegularExpressions;
using FluentValidation;
using FluentValidation.Results;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.Annotations;
using NzbDrone.Core.Indexers.Newznab;