mirror of
https://github.com/Prowlarr/Prowlarr
synced 2025-12-06 08:34:28 +01:00
Upgrade StyleCop.Analyzers to Unstable 1.2.0.556
This commit is contained in:
parent
cbcefa41ab
commit
cd680a47b5
110 changed files with 297 additions and 292 deletions
|
|
@ -141,9 +141,9 @@
|
|||
<!-- Set up stylecop -->
|
||||
<ItemGroup Condition="'$(ProwlarrProject)'=='true' and '$(EnableAnalyzers)'!='false'">
|
||||
<!-- StyleCop analysis -->
|
||||
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
|
||||
<PackageReference Include="StyleCop.Analyzers.Unstable" Version="1.2.0.556">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<AdditionalFiles Include="$(SolutionDir)stylecop.json" />
|
||||
</ItemGroup>
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ public class HttpClientFixture<TDispatcher> : TestBase<HttpClient>
|
|||
private string _httpBinHost;
|
||||
private string _httpBinHost2;
|
||||
|
||||
private System.Net.Http.HttpClient _httpClient = new ();
|
||||
private System.Net.Http.HttpClient _httpClient = new();
|
||||
|
||||
[OneTimeSetUp]
|
||||
public void FixtureSetUp()
|
||||
|
|
|
|||
|
|
@ -295,7 +295,7 @@ private string[] GetFragments()
|
|||
return _path.Split(new char[] { '\\', '/' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
}
|
||||
|
||||
public static OsPath Null => new (null);
|
||||
public static OsPath Null => new(null);
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ public static void Add<TKey, TValue>(this ICollection<KeyValuePair<TKey, TValue>
|
|||
}
|
||||
|
||||
public static IDictionary<TNewKey, TNewValue> SelectDictionary<TKey, TValue, TNewKey, TNewValue>(this IDictionary<TKey, TValue> dictionary,
|
||||
Func<KeyValuePair<TKey, TValue>, ValueTuple<TNewKey, TNewValue>> selection)
|
||||
Func<KeyValuePair<TKey, TValue>, (TNewKey Item1, TNewValue Item2)> selection)
|
||||
{
|
||||
return dictionary.Select(selection).ToDictionary(t => t.Item1, t => t.Item2);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ public static class CookieUtil
|
|||
{
|
||||
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie
|
||||
// NOTE: we are not checking non-ascii characters and we should
|
||||
private static readonly Regex CookieRegex = new (@"([^\(\)<>@,;:\\""/\[\]\?=\{\}\s]+)=([^,;\\""\s]+)");
|
||||
private static readonly Regex CookieRegex = new(@"([^\(\)<>@,;:\\""/\[\]\?=\{\}\s]+)=([^,;\\""\s]+)");
|
||||
private static readonly string[] FilterProps = { "COMMENT", "COMMENTURL", "DISCORD", "DOMAIN", "EXPIRES", "MAX-AGE", "PATH", "PORT", "SECURE", "VERSION", "HTTPONLY", "SAMESITE" };
|
||||
private static readonly char[] InvalidKeyChars = { '(', ')', '<', '>', '@', ',', ';', ':', '\\', '"', '/', '[', ']', '?', '=', '{', '}', ' ', '\t', '\n' };
|
||||
private static readonly char[] InvalidValueChars = { '"', ',', ';', '\\', ' ', '\t', '\n' };
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ namespace NzbDrone.Common.Http
|
|||
{
|
||||
public class HttpResponse
|
||||
{
|
||||
private static readonly Regex RegexRefresh = new ("^(.*?url)=(.*?)(?:;|$)", RegexOptions.Compiled);
|
||||
private static readonly Regex RegexRefresh = new("^(.*?url)=(.*?)(?:;|$)", RegexOptions.Compiled);
|
||||
|
||||
public HttpResponse(HttpRequest request, HttpHeader headers, CookieCollection cookies, byte[] binaryData, long elapsedTime = 0, HttpStatusCode statusCode = HttpStatusCode.OK, Version version = null)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ namespace NzbDrone.Common.Http
|
|||
{
|
||||
public static class UserAgentParser
|
||||
{
|
||||
private static readonly Regex AppSourceRegex = new (@"^(?<agent>[a-z0-9]+)(?:\/.+(?:\(.*\))?|$)",
|
||||
private static readonly Regex AppSourceRegex = new(@"^(?<agent>[a-z0-9]+)(?:\/.+(?:\(.*\))?|$)",
|
||||
RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
||||
|
||||
public static string SimplifyUserAgent(string userAgent)
|
||||
|
|
|
|||
|
|
@ -10,64 +10,64 @@ public class CleanseLogMessage
|
|||
private static readonly Regex[] CleansingRules =
|
||||
{
|
||||
// Url
|
||||
new (@"(?<=[?&: ;])(apikey|api_key|(?:(?:access|api)[-_]?)?token|pass(?:key|wd)?|auth|authkey|rsskey|user|u?id|api|[a-z_]*apikey|account|pid|pwd)=(?<secret>[^&=""]+?)(?=[ ""&=]|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new (@"(?<=[?& ;])[^=]*?(_?(?<!use|get_)token|username|passwo?rd)=(?<secret>[^&=]+?)(?= |&|$|;)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new (@"rss(24h)?\.torrentleech\.org/(?!rss)(?<secret>[0-9a-z]+)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new (@"torrentleech\.org/rss/download/[0-9]+/(?<secret>[0-9a-z]+)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new (@"iptorrents\.com/[/a-z0-9?&;]*?(?:[?&;](u|tp)=(?<secret>[^&=;]+?))+(?= |;|&|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new (@"/fetch/[a-z0-9]{32}/(?<secret>[a-z0-9]{32})", RegexOptions.Compiled),
|
||||
new (@"getnzb.*?(?<=\?|&)(r)=(?<secret>[^&=]+?)(?= |&|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new (@"\b(\w*)?(_?(?<!use|get_)token|username|passwo?rd)=(?<secret>[^&=]+?)(?= |&|$|;)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new (@"(?<=authkey = "")(?<secret>[^&=]+?)(?="")", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new (@"(?<=beyond-hd\.[a-z]+/api/torrents/)(?<secret>[^&=][a-z0-9]+)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new (@"(?<=beyond-hd\.[a-z]+/torrent/download/[\w\d-]+[.]\d+[.])(?<secret>[a-z0-9]+)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new (@"(?:sharewood)\.[a-z]{2,3}/api/(?<secret>[a-z0-9]{16,})/", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new(@"(?<=[?&: ;])(apikey|api_key|(?:(?:access|api)[-_]?)?token|pass(?:key|wd)?|auth|authkey|rsskey|user|u?id|api|[a-z_]*apikey|account|pid|pwd)=(?<secret>[^&=""]+?)(?=[ ""&=]|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new(@"(?<=[?& ;])[^=]*?(_?(?<!use|get_)token|username|passwo?rd)=(?<secret>[^&=]+?)(?= |&|$|;)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new(@"rss(24h)?\.torrentleech\.org/(?!rss)(?<secret>[0-9a-z]+)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new(@"torrentleech\.org/rss/download/[0-9]+/(?<secret>[0-9a-z]+)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new(@"iptorrents\.com/[/a-z0-9?&;]*?(?:[?&;](u|tp)=(?<secret>[^&=;]+?))+(?= |;|&|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new(@"/fetch/[a-z0-9]{32}/(?<secret>[a-z0-9]{32})", RegexOptions.Compiled),
|
||||
new(@"getnzb.*?(?<=\?|&)(r)=(?<secret>[^&=]+?)(?= |&|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new(@"\b(\w*)?(_?(?<!use|get_)token|username|passwo?rd)=(?<secret>[^&=]+?)(?= |&|$|;)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new(@"(?<=authkey = "")(?<secret>[^&=]+?)(?="")", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new(@"(?<=beyond-hd\.[a-z]+/api/torrents/)(?<secret>[^&=][a-z0-9]+)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new(@"(?<=beyond-hd\.[a-z]+/torrent/download/[\w\d-]+[.]\d+[.])(?<secret>[a-z0-9]+)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new(@"(?:sharewood)\.[a-z]{2,3}/api/(?<secret>[a-z0-9]{16,})/", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
|
||||
// UNIT3D
|
||||
new (@"(?<=[a-z0-9-]+\.[a-z]+/torrent/download/\d+\.)(?<secret>[^&=][a-z0-9]+)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new(@"(?<=[a-z0-9-]+\.[a-z]+/torrent/download/\d+\.)(?<secret>[^&=][a-z0-9]+)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
|
||||
// Path
|
||||
new (@"""C:\\Users\\(?<secret>[^\""]+?)(\\|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new (@"""/(home|Users)/(?<secret>[^/""]+?)(/|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new(@"""C:\\Users\\(?<secret>[^\""]+?)(\\|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new(@"""/(home|Users)/(?<secret>[^/""]+?)(/|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
|
||||
// Trackers Announce Keys; Designed for Qbit Json; should work for all in theory
|
||||
new (@"announce(\.php)?(/|%2f|%3fpasskey%3d)(?<secret>[a-z0-9]{16,})|(?<secret>[a-z0-9]{16,})(/|%2f)announce", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new(@"announce(\.php)?(/|%2f|%3fpasskey%3d)(?<secret>[a-z0-9]{16,})|(?<secret>[a-z0-9]{16,})(/|%2f)announce", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
|
||||
// NzbGet
|
||||
new (@"""Name""\s*:\s*""[^""]*(username|password)""\s*,\s*""Value""\s*:\s*""(?<secret>[^""]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new(@"""Name""\s*:\s*""[^""]*(username|password)""\s*,\s*""Value""\s*:\s*""(?<secret>[^""]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
|
||||
// Sabnzbd
|
||||
new (@"""[^""]*(username|password|api_?key|nzb_key)""\s*:\s*""(?<secret>[^""]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new (@"""email_(account|to|from|pwd)""\s*:\s*""(?<secret>[^""]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new(@"""[^""]*(username|password|api_?key|nzb_key)""\s*:\s*""(?<secret>[^""]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new(@"""email_(account|to|from|pwd)""\s*:\s*""(?<secret>[^""]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
|
||||
// uTorrent
|
||||
new (@"\[""[a-z._]*(username|password)"",\d,""(?<secret>[^""]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new (@"\[""(boss_key|boss_key_salt|proxy\.proxy)"",\d,""(?<secret>[^""]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new(@"\[""[a-z._]*(username|password)"",\d,""(?<secret>[^""]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new(@"\[""(boss_key|boss_key_salt|proxy\.proxy)"",\d,""(?<secret>[^""]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
|
||||
// Deluge
|
||||
new (@"auth.login\(""(?<secret>[^""]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new(@"auth.login\(""(?<secret>[^""]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
|
||||
// BroadcastheNet (;torrent_pass|torrents_notify_ is for MTV)
|
||||
new (@"""?method""?\s*:\s*""(getTorrents)"",\s*""?params""?\s*:\s*\[\s*""(?<secret>[^""]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new (@"getTorrents\(""(?<secret>[^""]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new (@"(?<=\?|&|;|=)(authkey|torrent_pass|torrents_notify)[_=](?<secret>[^&=]+?)(?=""|&|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new(@"""?method""?\s*:\s*""(getTorrents)"",\s*""?params""?\s*:\s*\[\s*""(?<secret>[^""]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new(@"getTorrents\(""(?<secret>[^""]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new(@"(?<=\?|&|;|=)(authkey|torrent_pass|torrents_notify)[_=](?<secret>[^&=]+?)(?=""|&|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
|
||||
// Plex
|
||||
new (@"(?<=\?|&)(X-Plex-Client-Identifier|X-Plex-Token)=(?<secret>[^&=]+?)(?= |&|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new(@"(?<=\?|&)(X-Plex-Client-Identifier|X-Plex-Token)=(?<secret>[^&=]+?)(?= |&|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
|
||||
// Indexer Responses
|
||||
new (@"(?:avistaz|exoticaz|cinemaz|privatehd)\.[a-z]{2,3}/rss/download/(?<secret>[^&=]+?)/(?<secret>[^&=]+?)\.torrent", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new (@"(?:animebytes)\.[a-z]{2,3}/torrent/[0-9]+/download/(?<secret>[^&=]+?)[""]", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new (@"""(info_hash|token|((pass|rss)[- _]?key))"":""(?<secret>[^&=]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new(@"(?:avistaz|exoticaz|cinemaz|privatehd)\.[a-z]{2,3}/rss/download/(?<secret>[^&=]+?)/(?<secret>[^&=]+?)\.torrent", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new(@"(?:animebytes)\.[a-z]{2,3}/torrent/[0-9]+/download/(?<secret>[^&=]+?)[""]", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new(@"""(info_hash|token|((pass|rss)[- _]?key))"":""(?<secret>[^&=]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
|
||||
// Applications
|
||||
new (@"""name"":""apikey"",""value"":""(?<secret>[^&=]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new(@"""name"":""apikey"",""value"":""(?<secret>[^&=]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
|
||||
// Discord
|
||||
new (@"discord.com/api/webhooks/((?<secret>[\w-]+)/)?(?<secret>[\w-]+)", RegexOptions.Compiled | RegexOptions.IgnoreCase)
|
||||
new(@"discord.com/api/webhooks/((?<secret>[\w-]+)/)?(?<secret>[\w-]+)", RegexOptions.Compiled | RegexOptions.IgnoreCase)
|
||||
};
|
||||
|
||||
private static readonly Regex CleanseRemoteIPRegex = new (@"(?:Auth-\w+(?<!Failure|Unauthorized) ip|from) (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})", RegexOptions.Compiled);
|
||||
private static readonly Regex CleanseRemoteIPRegex = new(@"(?:Auth-\w+(?<!Failure|Unauthorized) ip|from) (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})", RegexOptions.Compiled);
|
||||
|
||||
public static string Cleanse(string message)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@ public static class NzbDroneLogger
|
|||
private const string FileLogLayout = @"${date:format=yyyy-MM-dd HH\:mm\:ss.f}|${level}|${logger}|${message}${onexception:inner=${newline}${newline}[v${assembly-version}] ${exception:format=ToString}${newline}${exception:format=Data}${newline}}";
|
||||
private const string ConsoleFormat = "[${level}] ${logger}: ${message} ${onexception:inner=${newline}${newline}[v${assembly-version}] ${exception:format=ToString}${newline}${exception:format=Data}${newline}}";
|
||||
|
||||
private static readonly CleansingConsoleLogLayout CleansingConsoleLayout = new (ConsoleFormat);
|
||||
private static readonly CleansingClefLogLayout ClefLogLayout = new ();
|
||||
private static readonly CleansingConsoleLogLayout CleansingConsoleLayout = new(ConsoleFormat);
|
||||
private static readonly CleansingClefLogLayout ClefLogLayout = new();
|
||||
|
||||
private static bool _isConfigured;
|
||||
|
||||
|
|
|
|||
|
|
@ -94,7 +94,8 @@ private void NotifyThreadPoolOfPendingWork()
|
|||
{
|
||||
_currentThreadIsProcessingItems = false;
|
||||
}
|
||||
}, null);
|
||||
},
|
||||
null);
|
||||
}
|
||||
|
||||
/// <summary>Attempts to execute the specified task on the current thread.</summary>
|
||||
|
|
|
|||
|
|
@ -20,7 +20,8 @@ public static Task LogExceptions(this Task task)
|
|||
Logger.Error(exception, "Task Error");
|
||||
}
|
||||
}
|
||||
}, TaskContinuationOptions.OnlyOnFaulted);
|
||||
},
|
||||
TaskContinuationOptions.OnlyOnFaulted);
|
||||
|
||||
return task;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ public abstract class ApplicationBase<TSettings> : IApplication
|
|||
protected readonly IAppIndexerMapService _appIndexerMapService;
|
||||
protected readonly Logger _logger;
|
||||
|
||||
protected static readonly Regex AppIndexerRegex = new (@"\/(?<indexer>\d{1,3})(?:\/(?:api)?\/?)?$", RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
||||
protected static readonly Regex AppIndexerRegex = new(@"\/(?<indexer>\d{1,3})(?:\/(?:api)?\/?)?$", RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
||||
|
||||
public abstract string Name { get; }
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ public LazyLibrarianSettingsValidator()
|
|||
|
||||
public class LazyLibrarianSettings : IApplicationSettings
|
||||
{
|
||||
private static readonly LazyLibrarianSettingsValidator Validator = new ();
|
||||
private static readonly LazyLibrarianSettingsValidator Validator = new();
|
||||
|
||||
public LazyLibrarianSettings()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ public LidarrSettingsValidator()
|
|||
|
||||
public class LidarrSettings : IApplicationSettings
|
||||
{
|
||||
private static readonly LidarrSettingsValidator Validator = new ();
|
||||
private static readonly LidarrSettingsValidator Validator = new();
|
||||
|
||||
public LidarrSettings()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ public interface ILidarrV1Proxy
|
|||
|
||||
public class LidarrV1Proxy : ILidarrV1Proxy
|
||||
{
|
||||
private static Version MinimumApplicationVersion => new (1, 0, 2, 0);
|
||||
private static Version MinimumApplicationVersion => new(1, 0, 2, 0);
|
||||
|
||||
private const string AppApiRoute = "/api/v1";
|
||||
private const string AppIndexerApiRoute = $"{AppApiRoute}/indexer";
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ public MylarSettingsValidator()
|
|||
|
||||
public class MylarSettings : IApplicationSettings
|
||||
{
|
||||
private static readonly MylarSettingsValidator Validator = new ();
|
||||
private static readonly MylarSettingsValidator Validator = new();
|
||||
|
||||
public MylarSettings()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ public RadarrSettingsValidator()
|
|||
|
||||
public class RadarrSettings : IApplicationSettings
|
||||
{
|
||||
private static readonly RadarrSettingsValidator Validator = new ();
|
||||
private static readonly RadarrSettingsValidator Validator = new();
|
||||
|
||||
public RadarrSettings()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ public interface IRadarrV3Proxy
|
|||
|
||||
public class RadarrV3Proxy : IRadarrV3Proxy
|
||||
{
|
||||
private static Version MinimumApplicationV4Version => new (4, 0, 4, 0);
|
||||
private static Version MinimumApplicationV3Version => new (3, 1, 1, 0);
|
||||
private static Version MinimumApplicationV4Version => new(4, 0, 4, 0);
|
||||
private static Version MinimumApplicationV3Version => new(3, 1, 1, 0);
|
||||
|
||||
private const string AppApiRoute = "/api/v3";
|
||||
private const string AppIndexerApiRoute = $"{AppApiRoute}/indexer";
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ public ReadarrSettingsValidator()
|
|||
|
||||
public class ReadarrSettings : IApplicationSettings
|
||||
{
|
||||
private static readonly ReadarrSettingsValidator Validator = new ();
|
||||
private static readonly ReadarrSettingsValidator Validator = new();
|
||||
|
||||
public ReadarrSettings()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ public SonarrSettingsValidator()
|
|||
|
||||
public class SonarrSettings : IApplicationSettings
|
||||
{
|
||||
private static readonly SonarrSettingsValidator Validator = new ();
|
||||
private static readonly SonarrSettingsValidator Validator = new();
|
||||
|
||||
public SonarrSettings()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ public interface ISonarrV3Proxy
|
|||
|
||||
public class SonarrV3Proxy : ISonarrV3Proxy
|
||||
{
|
||||
private static Version MinimumApplicationVersion => new (3, 0, 5, 0);
|
||||
private static Version MinimumApplicationVersion => new(3, 0, 5, 0);
|
||||
|
||||
private const string AppApiRoute = "/api/v3";
|
||||
private const string AppIndexerApiRoute = $"{AppApiRoute}/indexer";
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ public WhisparrSettingsValidator()
|
|||
|
||||
public class WhisparrSettings : IApplicationSettings
|
||||
{
|
||||
private static readonly WhisparrSettingsValidator Validator = new ();
|
||||
private static readonly WhisparrSettingsValidator Validator = new();
|
||||
|
||||
public WhisparrSettings()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ namespace NzbDrone.Core.Datastore;
|
|||
|
||||
public static class DatabaseVersionParser
|
||||
{
|
||||
private static readonly Regex VersionRegex = new (@"^[^ ]+", RegexOptions.Compiled);
|
||||
private static readonly Regex VersionRegex = new(@"^[^ ]+", RegexOptions.Compiled);
|
||||
|
||||
public static Version ParseServerVersion(string serverVersion)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public FreeboxDownloadSettingsValidator()
|
|||
|
||||
public class FreeboxDownloadSettings : IProviderConfig
|
||||
{
|
||||
private static readonly FreeboxDownloadSettingsValidator Validator = new ();
|
||||
private static readonly FreeboxDownloadSettingsValidator Validator = new();
|
||||
|
||||
public FreeboxDownloadSettings()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ protected override string AddFromTorrentFile(TorrentInfo release, string hash, s
|
|||
|
||||
public override string Name => "uTorrent";
|
||||
|
||||
public override ProviderMessage Message => new (_localizationService.GetLocalizedString("DownloadClientUTorrentProviderMessage"), ProviderMessageType.Warning);
|
||||
public override ProviderMessage Message => new(_localizationService.GetLocalizedString("DownloadClientUTorrentProviderMessage"), ProviderMessageType.Warning);
|
||||
|
||||
public override bool SupportsCategories => true;
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ namespace NzbDrone.Core.Http.CloudFlare
|
|||
{
|
||||
public class CloudFlareDetectionService
|
||||
{
|
||||
private static readonly HashSet<string> CloudflareServerNames = new () { "cloudflare", "cloudflare-nginx", "ddos-guard" };
|
||||
private static readonly HashSet<string> CloudflareServerNames = new() { "cloudflare", "cloudflare-nginx", "ddos-guard" };
|
||||
private readonly Logger _logger;
|
||||
|
||||
public CloudFlareDetectionService(Logger logger)
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ namespace NzbDrone.Core.IndexerSearch.Definitions
|
|||
{
|
||||
public abstract class SearchCriteriaBase
|
||||
{
|
||||
private static readonly Regex StandardizeDashesRegex = new (@"\p{Pd}+", RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
||||
private static readonly Regex StandardizeSingleQuotesRegex = new (@"[\u0060\u00B4\u2018\u2019]", RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
||||
private static readonly Regex StandardizeDashesRegex = new(@"\p{Pd}+", RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
||||
private static readonly Regex StandardizeSingleQuotesRegex = new(@"[\u0060\u00B4\u2018\u2019]", RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
||||
|
||||
public virtual bool InteractiveSearch { get; set; }
|
||||
public List<int> IndexerIds { get; set; }
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@ namespace NzbDrone.Core.IndexerSearch
|
|||
{
|
||||
public class NewznabRequest
|
||||
{
|
||||
private static readonly Regex TvRegex = new (@"\{((?:imdbid\:)(?<imdbid>[^{]+)|(?:rid\:)(?<rid>[^{]+)|(?:tvdbid\:)(?<tvdbid>[^{]+)|(?:tmdbid\:)(?<tmdbid>[^{]+)|(?:tvmazeid\:)(?<tvmazeid>[^{]+)|(?:doubanid\:)(?<doubanid>[^{]+)|(?:season\:)(?<season>[^{]+)|(?:episode\:)(?<episode>[^{]+)|(?:year\:)(?<year>[^{]+)|(?:genre\:)(?<genre>[^{]+))\}", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private static readonly Regex MovieRegex = new (@"\{((?:imdbid\:)(?<imdbid>[^{]+)|(?:doubanid\:)(?<doubanid>[^{]+)|(?:tmdbid\:)(?<tmdbid>[^{]+)|(?:traktid\:)(?<traktid>[^{]+)|(?:year\:)(?<year>[^{]+)|(?:genre\:)(?<genre>[^{]+))\}", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private static readonly Regex MusicRegex = new (@"\{((?:artist\:)(?<artist>[^{]+)|(?:album\:)(?<album>[^{]+)|(?:track\:)(?<track>[^{]+)|(?:label\:)(?<label>[^{]+)|(?:year\:)(?<year>[^{]+)|(?:genre\:)(?<genre>[^{]+))\}", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private static readonly Regex BookRegex = new (@"\{((?:author\:)(?<author>[^{]+)|(?:publisher\:)(?<publisher>[^{]+)|(?:title\:)(?<title>[^{]+)|(?:year\:)(?<year>[^{]+)|(?:genre\:)(?<genre>[^{]+))\}", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private static readonly Regex TvRegex = new(@"\{((?:imdbid\:)(?<imdbid>[^{]+)|(?:rid\:)(?<rid>[^{]+)|(?:tvdbid\:)(?<tvdbid>[^{]+)|(?:tmdbid\:)(?<tmdbid>[^{]+)|(?:tvmazeid\:)(?<tvmazeid>[^{]+)|(?:doubanid\:)(?<doubanid>[^{]+)|(?:season\:)(?<season>[^{]+)|(?:episode\:)(?<episode>[^{]+)|(?:year\:)(?<year>[^{]+)|(?:genre\:)(?<genre>[^{]+))\}", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private static readonly Regex MovieRegex = new(@"\{((?:imdbid\:)(?<imdbid>[^{]+)|(?:doubanid\:)(?<doubanid>[^{]+)|(?:tmdbid\:)(?<tmdbid>[^{]+)|(?:traktid\:)(?<traktid>[^{]+)|(?:year\:)(?<year>[^{]+)|(?:genre\:)(?<genre>[^{]+))\}", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private static readonly Regex MusicRegex = new(@"\{((?:artist\:)(?<artist>[^{]+)|(?:album\:)(?<album>[^{]+)|(?:track\:)(?<track>[^{]+)|(?:label\:)(?<label>[^{]+)|(?:year\:)(?<year>[^{]+)|(?:genre\:)(?<genre>[^{]+))\}", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private static readonly Regex BookRegex = new(@"\{((?:author\:)(?<author>[^{]+)|(?:publisher\:)(?<publisher>[^{]+)|(?:title\:)(?<title>[^{]+)|(?:year\:)(?<year>[^{]+)|(?:genre\:)(?<genre>[^{]+))\}", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
|
||||
public string t { get; set; }
|
||||
public string q { get; set; }
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public class IndexerDefinitionUpdateService : IIndexerDefinitionUpdateService, I
|
|||
private const int DEFINITION_VERSION = 11;
|
||||
|
||||
// Used when moving yml to C#
|
||||
private readonly List<string> _definitionBlocklist = new ()
|
||||
private readonly List<string> _definitionBlocklist = new()
|
||||
{
|
||||
"aither",
|
||||
"animeworld",
|
||||
|
|
@ -251,8 +251,8 @@ private CardigannDefinition CleanIndexerDefinition(CardigannDefinition definitio
|
|||
{
|
||||
definition.Settings = new List<SettingsField>
|
||||
{
|
||||
new () { Name = "username", Label = "Username", Type = "text" },
|
||||
new () { Name = "password", Label = "Password", Type = "password" }
|
||||
new() { Name = "username", Label = "Username", Type = "text" },
|
||||
new() { Name = "password", Label = "Password", Type = "password" }
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -252,7 +252,7 @@ public class AnidubParser : IParseIndexerResponse
|
|||
private readonly IIndexerHttpClient _httpClient;
|
||||
private readonly Logger _logger;
|
||||
|
||||
private static Dictionary<string, string> CategoriesMap => new ()
|
||||
private static Dictionary<string, string> CategoriesMap => new()
|
||||
{
|
||||
{ "/anime_tv/full", "14" },
|
||||
{ "/anime_tv/anime_ongoing", "10" },
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ public class AnimeBytesRequestGenerator : IIndexerRequestGenerator
|
|||
private readonly AnimeBytesSettings _settings;
|
||||
private readonly IndexerCapabilities _capabilities;
|
||||
|
||||
private static Regex YearRegex => new (@"\b((?:19|20)\d{2})$", RegexOptions.Compiled);
|
||||
private static Regex YearRegex => new(@"\b((?:19|20)\d{2})$", RegexOptions.Compiled);
|
||||
|
||||
public AnimeBytesRequestGenerator(AnimeBytesSettings settings, IndexerCapabilities capabilities)
|
||||
{
|
||||
|
|
@ -290,16 +290,16 @@ private static string CleanSearchTerm(string term)
|
|||
|
||||
public class AnimeBytesParser : IParseIndexerResponse
|
||||
{
|
||||
private static readonly HashSet<string> ExcludedProperties = new (StringComparer.OrdinalIgnoreCase) { "Freeleech" };
|
||||
private static readonly HashSet<string> RemuxResolutions = new (StringComparer.OrdinalIgnoreCase) { "1080i", "1080p", "2160p", "4K" };
|
||||
private static readonly HashSet<string> CommonReleaseGroupsProperties = new (StringComparer.OrdinalIgnoreCase)
|
||||
private static readonly HashSet<string> ExcludedProperties = new(StringComparer.OrdinalIgnoreCase) { "Freeleech" };
|
||||
private static readonly HashSet<string> RemuxResolutions = new(StringComparer.OrdinalIgnoreCase) { "1080i", "1080p", "2160p", "4K" };
|
||||
private static readonly HashSet<string> CommonReleaseGroupsProperties = new(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
"Softsubs",
|
||||
"Hardsubs",
|
||||
"RAW",
|
||||
"Translated"
|
||||
};
|
||||
private static readonly HashSet<string> ExcludedFileExtensions = new (StringComparer.OrdinalIgnoreCase) { ".mka", ".mds", ".md5", ".nfo", ".sfv", ".ass", ".mks", ".srt", ".ssa", ".sup", ".jpeg", ".jpg", ".png", ".otf", ".ttf" };
|
||||
private static readonly HashSet<string> ExcludedFileExtensions = new(StringComparer.OrdinalIgnoreCase) { ".mka", ".mds", ".md5", ".nfo", ".sfv", ".ass", ".mks", ".srt", ".ssa", ".sup", ".jpeg", ".jpg", ".png", ".otf", ".ttf" };
|
||||
|
||||
private static readonly string[] PropertiesSeparator = { " | ", " / " };
|
||||
|
||||
|
|
@ -712,7 +712,7 @@ public AnimeBytesSettingsValidator()
|
|||
|
||||
public class AnimeBytesSettings : NoAuthTorrentBaseSettings
|
||||
{
|
||||
private static readonly AnimeBytesSettingsValidator Validator = new ();
|
||||
private static readonly AnimeBytesSettingsValidator Validator = new();
|
||||
|
||||
public AnimeBytesSettings()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ namespace NzbDrone.Core.Indexers.Definitions.Avistaz
|
|||
public class AvistazParserBase : IParseIndexerResponse
|
||||
{
|
||||
protected virtual string TimezoneOffset => "-04:00"; // Avistaz does not specify a timezone & returns server time
|
||||
private readonly HashSet<string> _hdResolutions = new () { "1080p", "1080i", "720p" };
|
||||
private readonly HashSet<string> _hdResolutions = new() { "1080p", "1080i", "720p" };
|
||||
|
||||
public Action<IDictionary<string, string>, DateTime?> CookiesUpdater { get; set; }
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ public AvistazSettingsValidator()
|
|||
|
||||
public class AvistazSettings : NoAuthTorrentBaseSettings
|
||||
{
|
||||
private static readonly AvistazSettingsValidator Validator = new ();
|
||||
private static readonly AvistazSettingsValidator Validator = new();
|
||||
|
||||
public AvistazSettings()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -234,7 +234,7 @@ public class BakaBTParser : IParseIndexerResponse
|
|||
{
|
||||
private readonly BakaBTSettings _settings;
|
||||
private readonly IndexerCapabilitiesCategories _categories;
|
||||
private readonly List<IndexerCategory> _defaultCategories = new () { NewznabStandardCategory.TVAnime };
|
||||
private readonly List<IndexerCategory> _defaultCategories = new() { NewznabStandardCategory.TVAnime };
|
||||
|
||||
public BakaBTParser(BakaBTSettings settings, IndexerCapabilitiesCategories categories)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -360,7 +360,7 @@ public BeyondHDSettingsValidator()
|
|||
|
||||
public class BeyondHDSettings : NoAuthTorrentBaseSettings
|
||||
{
|
||||
private static readonly BeyondHDSettingsValidator Validator = new ();
|
||||
private static readonly BeyondHDSettingsValidator Validator = new();
|
||||
|
||||
public BeyondHDSettings()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -216,7 +216,7 @@ public class BinSearchSettings : IIndexerSettings
|
|||
public string BaseUrl { get; set; }
|
||||
|
||||
[FieldDefinition(2)]
|
||||
public IndexerBaseSettings BaseSettings { get; set; } = new ();
|
||||
public IndexerBaseSettings BaseSettings { get; set; } = new();
|
||||
|
||||
public NzbDroneValidationResult Validate()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ namespace NzbDrone.Core.Indexers.BroadcastheNet
|
|||
{
|
||||
public class BroadcastheNetParser : IParseIndexerResponse
|
||||
{
|
||||
private static readonly Regex RegexProtocol = new ("^https?:", RegexOptions.Compiled);
|
||||
private static readonly Regex RegexProtocol = new("^https?:", RegexOptions.Compiled);
|
||||
|
||||
public Action<IDictionary<string, string>, DateTime?> CookiesUpdater { get; set; }
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ public BroadcastheNetSettingsValidator()
|
|||
|
||||
public class BroadcastheNetSettings : NoAuthTorrentBaseSettings
|
||||
{
|
||||
private static readonly BroadcastheNetSettingsValidator Validator = new ();
|
||||
private static readonly BroadcastheNetSettingsValidator Validator = new();
|
||||
|
||||
public BroadcastheNetSettings()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -128,8 +128,8 @@ private IndexerDefinition GetDefinition(CardigannMetaDefinition definition)
|
|||
{
|
||||
var defaultSettings = new List<SettingsField>
|
||||
{
|
||||
new () { Name = "username", Label = "Username", Type = "text" },
|
||||
new () { Name = "password", Label = "Password", Type = "password" }
|
||||
new() { Name = "username", Label = "Username", Type = "text" },
|
||||
new() { Name = "password", Label = "Password", Type = "password" }
|
||||
};
|
||||
|
||||
var settings = definition.Settings ?? defaultSettings;
|
||||
|
|
|
|||
|
|
@ -27,8 +27,8 @@ public class CardigannBase
|
|||
|
||||
protected virtual string SiteLink { get; private set; }
|
||||
|
||||
protected readonly IndexerCapabilitiesCategories _categories = new ();
|
||||
protected readonly List<string> _defaultCategories = new ();
|
||||
protected readonly IndexerCapabilitiesCategories _categories = new();
|
||||
protected readonly List<string> _defaultCategories = new();
|
||||
|
||||
protected readonly string[] OptionalFields = new string[] { "imdb", "imdbid", "tmdbid", "rageid", "tvdbid", "tvmazeid", "traktid", "doubanid", "poster", "banner", "description", "genre" };
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ public CardigannSettingsValidator()
|
|||
|
||||
public class CardigannSettings : NoAuthTorrentBaseSettings
|
||||
{
|
||||
private static readonly CardigannSettingsValidator Validator = new ();
|
||||
private static readonly CardigannSettingsValidator Validator = new();
|
||||
|
||||
public CardigannSettings()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ public FileListSettingsValidator()
|
|||
|
||||
public class FileListSettings : NoAuthTorrentBaseSettings
|
||||
{
|
||||
private static readonly FileListSettingsValidator Validator = new ();
|
||||
private static readonly FileListSettingsValidator Validator = new();
|
||||
|
||||
public FileListSettings()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -228,7 +228,7 @@ public class FunFileParser : IParseIndexerResponse
|
|||
private readonly UserPassTorrentBaseSettings _settings;
|
||||
private readonly IndexerCapabilitiesCategories _categories;
|
||||
|
||||
private readonly List<string> _validTagList = new ()
|
||||
private readonly List<string> _validTagList = new()
|
||||
{
|
||||
"action",
|
||||
"adventure",
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ public class GazelleSettingsValidator<T> : UserPassBaseSettingsValidator<T>
|
|||
|
||||
public class GazelleSettings : UserPassTorrentBaseSettings
|
||||
{
|
||||
private static readonly GazelleSettingsValidator<GazelleSettings> Validator = new ();
|
||||
private static readonly GazelleSettingsValidator<GazelleSettings> Validator = new();
|
||||
|
||||
public string AuthKey { get; set; }
|
||||
public string PassKey { get; set; }
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ public GazelleUserPassOrCookieValidator()
|
|||
|
||||
public class GazelleUserPassOrCookieSettings : GazelleSettings
|
||||
{
|
||||
private static readonly GazelleUserPassOrCookieValidator<GazelleUserPassOrCookieSettings> Validator = new ();
|
||||
private static readonly GazelleUserPassOrCookieValidator<GazelleUserPassOrCookieSettings> Validator = new();
|
||||
|
||||
[FieldDefinition(4, Label = "Cookie", HelpText = "Use the Cookie field only if 2FA is enabled for your account, leave it empty otherwise.", HelpLink = "https://wiki.servarr.com/useful-tools#finding-cookies", Privacy = PrivacyLevel.Password)]
|
||||
public string Cookie { get; set; }
|
||||
|
|
|
|||
|
|
@ -369,7 +369,7 @@ public class GazelleGamesParser : IParseIndexerResponse
|
|||
private readonly GazelleGamesSettings _settings;
|
||||
private readonly IndexerCapabilitiesCategories _categories;
|
||||
|
||||
private static Regex YearRegex => new (@"\b(?:19|20|21)\d{2}\b", RegexOptions.Compiled);
|
||||
private static Regex YearRegex => new(@"\b(?:19|20|21)\d{2}\b", RegexOptions.Compiled);
|
||||
|
||||
public GazelleGamesParser(GazelleGamesSettings settings, IndexerCapabilitiesCategories categories)
|
||||
{
|
||||
|
|
@ -553,7 +553,7 @@ public GazelleGamesSettingsValidator()
|
|||
|
||||
public class GazelleGamesSettings : NoAuthTorrentBaseSettings
|
||||
{
|
||||
private static readonly GazelleGamesSettingsValidator Validator = new ();
|
||||
private static readonly GazelleGamesSettingsValidator Validator = new();
|
||||
|
||||
public GazelleGamesSettings()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ public class GreatPosterWallParser : GazelleParser
|
|||
private readonly GreatPosterWallSettings _settings;
|
||||
private readonly Logger _logger;
|
||||
|
||||
private readonly HashSet<string> _hdResolutions = new () { "1080p", "1080i", "720p" };
|
||||
private readonly HashSet<string> _hdResolutions = new() { "1080p", "1080i", "720p" };
|
||||
|
||||
public GreatPosterWallParser(GreatPosterWallSettings settings, IndexerCapabilities capabilities, Logger logger)
|
||||
: base(settings, capabilities)
|
||||
|
|
@ -272,7 +272,7 @@ var res when _hdResolutions.Contains(res) => NewznabStandardCategory.MoviesHD,
|
|||
|
||||
public class GreatPosterWallSettings : GazelleUserPassOrCookieSettings
|
||||
{
|
||||
private static readonly GazelleUserPassOrCookieValidator<GreatPosterWallSettings> Validator = new ();
|
||||
private static readonly GazelleUserPassOrCookieValidator<GreatPosterWallSettings> Validator = new();
|
||||
|
||||
[FieldDefinition(6, Label = "Freeleech Only", Type = FieldType.Checkbox, HelpText = "Search freeleech torrents only")]
|
||||
public bool FreeleechOnly { get; set; }
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ public class HDBitsParser : IParseIndexerResponse
|
|||
private readonly HDBitsSettings _settings;
|
||||
private readonly IndexerCapabilitiesCategories _categories;
|
||||
|
||||
private readonly List<int> _halfLeechMediums = new () { (int)HdBitsMedium.Bluray, (int)HdBitsMedium.Remux, (int)HdBitsMedium.Capture };
|
||||
private readonly List<int> _halfLeechMediums = new() { (int)HdBitsMedium.Bluray, (int)HdBitsMedium.Remux, (int)HdBitsMedium.Capture };
|
||||
|
||||
public HDBitsParser(HDBitsSettings settings, IndexerCapabilitiesCategories categories)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ public HDBitsSettingsValidator()
|
|||
|
||||
public class HDBitsSettings : NoAuthTorrentBaseSettings
|
||||
{
|
||||
private static readonly HDBitsSettingsValidator Validator = new ();
|
||||
private static readonly HDBitsSettingsValidator Validator = new();
|
||||
|
||||
public HDBitsSettings()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -234,8 +234,8 @@ public class HDTorrentsParser : IParseIndexerResponse
|
|||
private readonly UserPassTorrentBaseSettings _settings;
|
||||
private readonly IndexerCapabilitiesCategories _categories;
|
||||
|
||||
private readonly Regex _posterRegex = new (@"src=\\'./([^']+)\\'", RegexOptions.IgnoreCase);
|
||||
private readonly HashSet<string> _freeleechRanks = new (StringComparer.OrdinalIgnoreCase)
|
||||
private readonly Regex _posterRegex = new(@"src=\\'./([^']+)\\'", RegexOptions.IgnoreCase);
|
||||
private readonly HashSet<string> _freeleechRanks = new(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
"VIP",
|
||||
"Uploader",
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ public HeadphonesSettingsValidator()
|
|||
|
||||
public class HeadphonesSettings : IIndexerSettings
|
||||
{
|
||||
private static readonly HeadphonesSettingsValidator Validator = new ();
|
||||
private static readonly HeadphonesSettingsValidator Validator = new();
|
||||
|
||||
public HeadphonesSettings()
|
||||
{
|
||||
|
|
@ -38,7 +38,7 @@ public HeadphonesSettings()
|
|||
public string Password { get; set; }
|
||||
|
||||
[FieldDefinition(4)]
|
||||
public IndexerBaseSettings BaseSettings { get; set; } = new ();
|
||||
public IndexerBaseSettings BaseSettings { get; set; } = new();
|
||||
|
||||
public virtual NzbDroneValidationResult Validate()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -424,7 +424,7 @@ public IPTorrentsValidator()
|
|||
|
||||
public class IPTorrentsSettings : CookieTorrentBaseSettings
|
||||
{
|
||||
private static readonly IPTorrentsValidator Validator = new ();
|
||||
private static readonly IPTorrentsValidator Validator = new();
|
||||
|
||||
[FieldDefinition(3, Label = "IndexerIPTorrentsSettingsCookieUserAgent", Type = FieldType.Textbox, HelpText = "IndexerIPTorrentsSettingsCookieUserAgentHelpText")]
|
||||
public string UserAgent { get; set; }
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@ public class ImmortalSeedParser : IParseIndexerResponse
|
|||
private readonly ImmortalSeedSettings _settings;
|
||||
private readonly IndexerCapabilitiesCategories _categories;
|
||||
|
||||
private readonly Regex _dateAddedRegex = new (@"\d{4}-\d{2}-\d{2} \d{2}:\d{2} [AaPp][Mm]", RegexOptions.Compiled);
|
||||
private readonly Regex _dateAddedRegex = new(@"\d{4}-\d{2}-\d{2} \d{2}:\d{2} [AaPp][Mm]", RegexOptions.Compiled);
|
||||
|
||||
public ImmortalSeedParser(ImmortalSeedSettings settings, IndexerCapabilitiesCategories categories)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -247,7 +247,7 @@ private IEnumerable<IndexerRequest> CreateRequest(SearchCriteriaBase searchCrite
|
|||
|
||||
public class KnabenParser : IParseIndexerResponse
|
||||
{
|
||||
private static readonly Regex DateTimezoneRegex = new (@"[+-]\d{2}:\d{2}$", RegexOptions.Compiled);
|
||||
private static readonly Regex DateTimezoneRegex = new(@"[+-]\d{2}:\d{2}$", RegexOptions.Compiled);
|
||||
|
||||
private readonly IndexerCapabilitiesCategories _categories;
|
||||
|
||||
|
|
|
|||
|
|
@ -226,7 +226,7 @@ private IEnumerable<IndexerRequest> GetPagedRequests(SearchCriteriaBase searchCr
|
|||
public class LibbleParser : IParseIndexerResponse
|
||||
{
|
||||
private readonly LibbleSettings _settings;
|
||||
private static Regex ReleaseYearRegex => new (@"\[(\d{4})\]$", RegexOptions.Compiled);
|
||||
private static Regex ReleaseYearRegex => new(@"\[(\d{4})\]$", RegexOptions.Compiled);
|
||||
|
||||
public LibbleParser(LibbleSettings settings)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -427,7 +427,7 @@ public MTeamTpValidator()
|
|||
|
||||
public class MTeamTpSettings : NoAuthTorrentBaseSettings
|
||||
{
|
||||
private static readonly MTeamTpValidator Validator = new ();
|
||||
private static readonly MTeamTpValidator Validator = new();
|
||||
|
||||
[FieldDefinition(2, Label = "ApiKey", HelpText = "IndexerMTeamTpSettingsApiKeyHelpText", Privacy = PrivacyLevel.ApiKey)]
|
||||
public string ApiKey { get; set; }
|
||||
|
|
|
|||
|
|
@ -258,7 +258,7 @@ private IndexerCapabilities SetCapabilities()
|
|||
|
||||
public class MyAnonamouseRequestGenerator : IIndexerRequestGenerator
|
||||
{
|
||||
private static readonly Regex SanitizeSearchQueryRegex = new ("[^\\w]+", RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
||||
private static readonly Regex SanitizeSearchQueryRegex = new("[^\\w]+", RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
||||
|
||||
private readonly MyAnonamouseSettings _settings;
|
||||
private readonly IndexerCapabilities _capabilities;
|
||||
|
|
@ -417,7 +417,7 @@ public class MyAnonamouseParser : IParseIndexerResponse
|
|||
private readonly Logger _logger;
|
||||
|
||||
private readonly ICached<string> _userClassCache;
|
||||
private readonly HashSet<string> _vipFreeleechUserClasses = new (StringComparer.OrdinalIgnoreCase)
|
||||
private readonly HashSet<string> _vipFreeleechUserClasses = new(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
"VIP",
|
||||
"Elite VIP"
|
||||
|
|
@ -613,7 +613,7 @@ public MyAnonamouseSettingsValidator()
|
|||
|
||||
public class MyAnonamouseSettings : NoAuthTorrentBaseSettings
|
||||
{
|
||||
private static readonly MyAnonamouseSettingsValidator Validator = new ();
|
||||
private static readonly MyAnonamouseSettingsValidator Validator = new();
|
||||
|
||||
public MyAnonamouseSettings()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ public NewznabSettingsValidator()
|
|||
|
||||
public class NewznabSettings : IIndexerSettings
|
||||
{
|
||||
private static readonly NewznabSettingsValidator Validator = new ();
|
||||
private static readonly NewznabSettingsValidator Validator = new();
|
||||
|
||||
public NewznabSettings()
|
||||
{
|
||||
|
|
@ -74,7 +74,7 @@ public NewznabSettings()
|
|||
public string VipExpiration { get; set; }
|
||||
|
||||
[FieldDefinition(7)]
|
||||
public IndexerBaseSettings BaseSettings { get; set; } = new ();
|
||||
public IndexerBaseSettings BaseSettings { get; set; } = new();
|
||||
|
||||
public NewznabCapabilitiesSettings Capabilities { get; set; }
|
||||
|
||||
|
|
|
|||
|
|
@ -1111,7 +1111,7 @@ public class NzbIndexParser : IParseIndexerResponse
|
|||
private readonly NzbIndexSettings _settings;
|
||||
private readonly IndexerCapabilitiesCategories _categories;
|
||||
|
||||
private static readonly Regex ParseTitleRegex = new (@"\""(?<title>[^:\/]*?)(?:\.(rar|nfo|mkv|par2|001|nzb|url|zip|r[0-9]{2}))?\""", RegexOptions.Compiled);
|
||||
private static readonly Regex ParseTitleRegex = new(@"\""(?<title>[^:\/]*?)(?:\.(rar|nfo|mkv|par2|001|nzb|url|zip|r[0-9]{2}))?\""", RegexOptions.Compiled);
|
||||
|
||||
public NzbIndexParser(NzbIndexSettings settings, IndexerCapabilitiesCategories categories)
|
||||
{
|
||||
|
|
@ -1181,7 +1181,7 @@ public NzbIndexSettingsValidator()
|
|||
|
||||
public class NzbIndexSettings : IIndexerSettings
|
||||
{
|
||||
private static readonly NzbIndexSettingsValidator Validator = new ();
|
||||
private static readonly NzbIndexSettingsValidator Validator = new();
|
||||
|
||||
public NzbIndexSettings()
|
||||
{
|
||||
|
|
@ -1195,7 +1195,7 @@ public NzbIndexSettings()
|
|||
public string ApiKey { get; set; }
|
||||
|
||||
[FieldDefinition(3)]
|
||||
public IndexerBaseSettings BaseSettings { get; set; } = new ();
|
||||
public IndexerBaseSettings BaseSettings { get; set; } = new();
|
||||
|
||||
public NzbDroneValidationResult Validate()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -445,7 +445,7 @@ public OrpheusSettingsValidator()
|
|||
|
||||
public class OrpheusSettings : NoAuthTorrentBaseSettings
|
||||
{
|
||||
private static readonly OrpheusSettingsValidator Validator = new ();
|
||||
private static readonly OrpheusSettingsValidator Validator = new();
|
||||
|
||||
public OrpheusSettings()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ private IndexerCapabilities SetCapabilities()
|
|||
|
||||
public class PassThePopcornFlag : IndexerFlag
|
||||
{
|
||||
public static IndexerFlag Golden => new ("golden", "Release follows Golden Popcorn quality rules");
|
||||
public static IndexerFlag Approved => new ("approved", "Release approved by PTP staff");
|
||||
public static IndexerFlag Golden => new("golden", "Release follows Golden Popcorn quality rules");
|
||||
public static IndexerFlag Approved => new("approved", "Release approved by PTP staff");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ public PassThePopcornSettingsValidator()
|
|||
|
||||
public class PassThePopcornSettings : NoAuthTorrentBaseSettings
|
||||
{
|
||||
private static readonly PassThePopcornSettingsValidator Validator = new ();
|
||||
private static readonly PassThePopcornSettingsValidator Validator = new();
|
||||
|
||||
public PassThePopcornSettings()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -242,7 +242,7 @@ public PixelHDSettingsValidator()
|
|||
|
||||
public class PixelHDSettings : CookieTorrentBaseSettings
|
||||
{
|
||||
private static readonly PixelHDSettingsValidator Validator = new ();
|
||||
private static readonly PixelHDSettingsValidator Validator = new();
|
||||
|
||||
[FieldDefinition(3, Label = "Cookie User-Agent", Type = FieldType.Textbox, HelpText = "User-Agent associated with cookie used from Browser")]
|
||||
public string UserAgent { get; set; }
|
||||
|
|
|
|||
|
|
@ -323,7 +323,7 @@ public class PornoLabParser : IParseIndexerResponse
|
|||
private readonly PornoLabSettings _settings;
|
||||
private readonly IndexerCapabilitiesCategories _categories;
|
||||
private readonly Logger _logger;
|
||||
private static readonly Regex StripRussianRegex = new (@"(\([\p{IsCyrillic}\W]+\))|(^[\p{IsCyrillic}\W\d]+\/ )|([\p{IsCyrillic} \-]+,+)|([\p{IsCyrillic}]+)");
|
||||
private static readonly Regex StripRussianRegex = new(@"(\([\p{IsCyrillic}\W]+\))|(^[\p{IsCyrillic}\W\d]+\/ )|([\p{IsCyrillic} \-]+,+)|([\p{IsCyrillic}]+)");
|
||||
|
||||
public PornoLabParser(PornoLabSettings settings, IndexerCapabilitiesCategories categories, Logger logger)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -396,7 +396,7 @@ public PreToMeSettingsValidator()
|
|||
|
||||
public class PreToMeSettings : UserPassTorrentBaseSettings
|
||||
{
|
||||
private static readonly PreToMeSettingsValidator Validator = new ();
|
||||
private static readonly PreToMeSettingsValidator Validator = new();
|
||||
|
||||
[FieldDefinition(4, Label = "Pin", HelpText = "Site Pin", Privacy = PrivacyLevel.Password)]
|
||||
public string Pin { get; set; }
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ namespace NzbDrone.Core.Indexers.Definitions.Rarbg
|
|||
{
|
||||
public class RarbgParser : IParseIndexerResponse
|
||||
{
|
||||
private static readonly Regex RegexGuid = new (@"^magnet:\?xt=urn:btih:([a-f0-9]+)", RegexOptions.Compiled);
|
||||
private static readonly Regex RegexGuid = new(@"^magnet:\?xt=urn:btih:([a-f0-9]+)", RegexOptions.Compiled);
|
||||
|
||||
private readonly IndexerCapabilities _capabilities;
|
||||
private readonly Logger _logger;
|
||||
|
|
|
|||
|
|
@ -456,7 +456,7 @@ public RedactedSettingsValidator()
|
|||
|
||||
public class RedactedSettings : NoAuthTorrentBaseSettings
|
||||
{
|
||||
private static readonly RedactedSettingsValidator Validator = new ();
|
||||
private static readonly RedactedSettingsValidator Validator = new();
|
||||
|
||||
public RedactedSettings()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1579,7 +1579,7 @@ public class RuTrackerParser : IParseIndexerResponse
|
|||
private readonly RuTrackerSettings _settings;
|
||||
private readonly IndexerCapabilitiesCategories _categories;
|
||||
|
||||
private readonly RuTrackerTitleParser _titleParser = new ();
|
||||
private readonly RuTrackerTitleParser _titleParser = new();
|
||||
|
||||
public RuTrackerParser(RuTrackerSettings settings, IndexerCapabilitiesCategories categories)
|
||||
{
|
||||
|
|
@ -1696,22 +1696,22 @@ private DateTime GetPublishDateOfRelease(in IElement row)
|
|||
|
||||
public class RuTrackerTitleParser
|
||||
{
|
||||
private static readonly List<Regex> FindTagsInTitlesRegexList = new ()
|
||||
private static readonly List<Regex> FindTagsInTitlesRegexList = new()
|
||||
{
|
||||
new Regex(@"\((?>\((?<c>)|[^()]+|\)(?<-c>))*(?(c)(?!))\)"),
|
||||
new Regex(@"\[(?>\[(?<c>)|[^\[\]]+|\](?<-c>))*(?(c)(?!))\]")
|
||||
};
|
||||
|
||||
private readonly Regex _stripCyrillicRegex = new (@"(\([\p{IsCyrillic}\W]+\))|(^[\p{IsCyrillic}\W\d]+\/ )|([\p{IsCyrillic} \-]+,+)|([\p{IsCyrillic}]+)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private readonly Regex _stripCyrillicRegex = new(@"(\([\p{IsCyrillic}\W]+\))|(^[\p{IsCyrillic}\W\d]+\/ )|([\p{IsCyrillic} \-]+,+)|([\p{IsCyrillic}]+)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
|
||||
private readonly Regex _tvTitleCommaRegex = new (@"\s(\d+),(\d+)", RegexOptions.Compiled);
|
||||
private readonly Regex _tvTitleCyrillicXRegex = new (@"([\s-])Х+([\s\)\]])", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private readonly Regex _tvTitleCommaRegex = new(@"\s(\d+),(\d+)", RegexOptions.Compiled);
|
||||
private readonly Regex _tvTitleCyrillicXRegex = new(@"([\s-])Х+([\s\)\]])", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
|
||||
private readonly Regex _tvTitleRusSeasonEpisodeOfRegex = new (@"Сезон\s*[:]*\s+(\d+).+(?:Серии|Эпизод|Выпуски)+\s*[:]*\s+(\d+(?:-\d+)?)\s*из\s*([\w?])", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private readonly Regex _tvTitleRusSeasonEpisodeRegex = new (@"Сезон\s*[:]*\s+(\d+).+(?:Серии|Эпизод|Выпуски)+\s*[:]*\s+(\d+(?:-\d+)?)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private readonly Regex _tvTitleRusSeasonRegex = new (@"Сезон\s*[:]*\s+(\d+(?:-\d+)?)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private readonly Regex _tvTitleRusEpisodeOfRegex = new (@"(?:Серии|Эпизод|Выпуски)+\s*[:]*\s+(\d+(?:-\d+)?)\s*из\s*([\w?])", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private readonly Regex _tvTitleRusEpisodeRegex = new (@"(?:Серии|Эпизод|Выпуски)+\s*[:]*\s+(\d+(?:-\d+)?)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private readonly Regex _tvTitleRusSeasonEpisodeOfRegex = new(@"Сезон\s*[:]*\s+(\d+).+(?:Серии|Эпизод|Выпуски)+\s*[:]*\s+(\d+(?:-\d+)?)\s*из\s*([\w?])", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private readonly Regex _tvTitleRusSeasonEpisodeRegex = new(@"Сезон\s*[:]*\s+(\d+).+(?:Серии|Эпизод|Выпуски)+\s*[:]*\s+(\d+(?:-\d+)?)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private readonly Regex _tvTitleRusSeasonRegex = new(@"Сезон\s*[:]*\s+(\d+(?:-\d+)?)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private readonly Regex _tvTitleRusEpisodeOfRegex = new(@"(?:Серии|Эпизод|Выпуски)+\s*[:]*\s+(\d+(?:-\d+)?)\s*из\s*([\w?])", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private readonly Regex _tvTitleRusEpisodeRegex = new(@"(?:Серии|Эпизод|Выпуски)+\s*[:]*\s+(\d+(?:-\d+)?)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
|
||||
public string Parse(string title,
|
||||
ICollection<IndexerCategory> categories,
|
||||
|
|
|
|||
|
|
@ -241,7 +241,7 @@ public SceneHDSettingsValidator()
|
|||
|
||||
public class SceneHDSettings : NoAuthTorrentBaseSettings
|
||||
{
|
||||
private static readonly SceneHDSettingsValidator Validator = new ();
|
||||
private static readonly SceneHDSettingsValidator Validator = new();
|
||||
|
||||
public SceneHDSettings()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -209,8 +209,8 @@ public class ShazbatParser : IParseIndexerResponse
|
|||
private readonly IIndexerHttpClient _httpClient;
|
||||
private readonly Logger _logger;
|
||||
|
||||
private readonly Regex _torrentInfoRegex = new (@"\((?<size>\d+)\):(?<seeders>\d+) \/ :(?<leechers>\d+)$", RegexOptions.Compiled);
|
||||
private readonly HashSet<string> _hdResolutions = new () { "1080p", "1080i", "720p" };
|
||||
private readonly Regex _torrentInfoRegex = new(@"\((?<size>\d+)\):(?<seeders>\d+) \/ :(?<leechers>\d+)$", RegexOptions.Compiled);
|
||||
private readonly HashSet<string> _hdResolutions = new() { "1080p", "1080i", "720p" };
|
||||
|
||||
public ShazbatParser(ProviderDefinition definition, ShazbatSettings settings, TimeSpan rateLimit, IIndexerHttpClient httpClient, Logger logger)
|
||||
{
|
||||
|
|
@ -393,7 +393,7 @@ public ShazbatSettingsValidator()
|
|||
|
||||
public class ShazbatSettings : UserPassTorrentBaseSettings
|
||||
{
|
||||
private static readonly ShazbatSettingsValidator Validator = new ();
|
||||
private static readonly ShazbatSettingsValidator Validator = new();
|
||||
|
||||
[FieldDefinition(4, Type = FieldType.Number, Label = "Show Pages Fetch Limit", HelpText = "The number of show pages should Prowlarr fetch when searching. Default: 2.")]
|
||||
public int? ShowPagesFetchLimit { get; set; }
|
||||
|
|
|
|||
|
|
@ -302,7 +302,7 @@ public SpeedAppSettingsValidator()
|
|||
|
||||
public class SpeedAppSettings : NoAuthTorrentBaseSettings
|
||||
{
|
||||
private static readonly SpeedAppSettingsValidator Validator = new ();
|
||||
private static readonly SpeedAppSettingsValidator Validator = new();
|
||||
|
||||
public SpeedAppSettings()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ private IndexerCapabilities SetCapabilities()
|
|||
|
||||
public class SubsPleaseRequestGenerator : IIndexerRequestGenerator
|
||||
{
|
||||
private static readonly Regex ResolutionRegex = new (@"\d{3,4}p", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private static readonly Regex ResolutionRegex = new(@"\d{3,4}p", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
|
||||
private readonly NoAuthTorrentBaseSettings _settings;
|
||||
|
||||
|
|
@ -172,7 +172,7 @@ private IEnumerable<IndexerRequest> GetSearchRequests(string term, SearchCriteri
|
|||
|
||||
public class SubsPleaseParser : IParseIndexerResponse
|
||||
{
|
||||
private static readonly Regex RegexSize = new (@"\&xl=(?<size>\d+)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private static readonly Regex RegexSize = new(@"\&xl=(?<size>\d+)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
|
||||
private readonly NoAuthTorrentBaseSettings _settings;
|
||||
|
||||
|
|
|
|||
|
|
@ -355,7 +355,7 @@ public class TolokaParser : IParseIndexerResponse
|
|||
private readonly TolokaSettings _settings;
|
||||
private readonly IndexerCapabilitiesCategories _categories;
|
||||
|
||||
private readonly TolokaTitleParser _titleParser = new ();
|
||||
private readonly TolokaTitleParser _titleParser = new();
|
||||
|
||||
public TolokaParser(TolokaSettings settings, IndexerCapabilitiesCategories categories)
|
||||
{
|
||||
|
|
@ -437,30 +437,30 @@ public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
|
|||
|
||||
public class TolokaTitleParser
|
||||
{
|
||||
private static readonly List<Regex> FindTagsInTitlesRegexList = new ()
|
||||
private static readonly List<Regex> FindTagsInTitlesRegexList = new()
|
||||
{
|
||||
new Regex(@"\((?>\((?<c>)|[^()]+|\)(?<-c>))*(?(c)(?!))\)"),
|
||||
new Regex(@"\[(?>\[(?<c>)|[^\[\]]+|\](?<-c>))*(?(c)(?!))\]")
|
||||
};
|
||||
|
||||
private readonly Regex _tvTitleCommaRegex = new (@"\s(\d+),(\d+)", RegexOptions.Compiled);
|
||||
private readonly Regex _tvTitleCyrillicXRegex = new (@"([\s-])Х+([\)\]])", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private readonly Regex _tvTitleCommaRegex = new(@"\s(\d+),(\d+)", RegexOptions.Compiled);
|
||||
private readonly Regex _tvTitleCyrillicXRegex = new(@"([\s-])Х+([\)\]])", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
|
||||
private readonly Regex _tvTitleMultipleSeasonsRegex = new (@"(?:Сезон|Seasons?)\s*[:]*\s+(\d+-\d+)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private readonly Regex _tvTitleMultipleSeasonsRegex = new(@"(?:Сезон|Seasons?)\s*[:]*\s+(\d+-\d+)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
|
||||
private readonly Regex _tvTitleUkrSeasonEpisodeOfRegex = new (@"Сезон\s*[:]*\s+(\d+).+(?:Серії|Серія|Серій|Епізод)+\s*[:]*\s+(\d+(?:-\d+)?)\s*з\s*([\w?])", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private readonly Regex _tvTitleUkrSeasonEpisodeRegex = new (@"Сезон\s*[:]*\s+(\d+).+(?:Серії|Серія|Серій|Епізод)+\s*[:]*\s+(\d+(?:-\d+)?)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private readonly Regex _tvTitleUkrSeasonRegex = new (@"Сезон\s*[:]*\s+(\d+)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private readonly Regex _tvTitleUkrEpisodeOfRegex = new (@"(?:Серії|Серія|Серій|Епізод)+\s*[:]*\s+(\d+(?:-\d+)?)\s*з\s*([\w?])", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private readonly Regex _tvTitleUkrEpisodeRegex = new (@"(?:Серії|Серія|Серій|Епізод)+\s*[:]*\s+(\d+(?:-\d+)?)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private readonly Regex _tvTitleUkrSeasonEpisodeOfRegex = new(@"Сезон\s*[:]*\s+(\d+).+(?:Серії|Серія|Серій|Епізод)+\s*[:]*\s+(\d+(?:-\d+)?)\s*з\s*([\w?])", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private readonly Regex _tvTitleUkrSeasonEpisodeRegex = new(@"Сезон\s*[:]*\s+(\d+).+(?:Серії|Серія|Серій|Епізод)+\s*[:]*\s+(\d+(?:-\d+)?)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private readonly Regex _tvTitleUkrSeasonRegex = new(@"Сезон\s*[:]*\s+(\d+)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private readonly Regex _tvTitleUkrEpisodeOfRegex = new(@"(?:Серії|Серія|Серій|Епізод)+\s*[:]*\s+(\d+(?:-\d+)?)\s*з\s*([\w?])", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private readonly Regex _tvTitleUkrEpisodeRegex = new(@"(?:Серії|Серія|Серій|Епізод)+\s*[:]*\s+(\d+(?:-\d+)?)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
|
||||
private readonly Regex _tvTitleEngSeasonEpisodeOfRegex = new (@"Season\s*[:]*\s+(\d+).+(?:Episodes?)+\s*[:]*\s+(\d+(?:-\d+)?)\s*of\s*([\w?])", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private readonly Regex _tvTitleEngSeasonEpisodeRegex = new (@"Season\s*[:]*\s+(\d+).+(?:Episodes?)+\s*[:]*\s+(\d+(?:-\d+)?)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private readonly Regex _tvTitleEngSeasonRegex = new (@"Season\s*[:]*\s+(\d+(?:-\d+)?)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private readonly Regex _tvTitleEngEpisodeOfRegex = new (@"(?:Episodes?)+\s*[:]*\s+(\d+(?:-\d+)?)\s*of\s*([\w?])", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private readonly Regex _tvTitleEngEpisodeRegex = new (@"(?:Episodes?)+\s*[:]+\s*[:]*\s+(\d+(?:-\d+)?)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private readonly Regex _tvTitleEngSeasonEpisodeOfRegex = new(@"Season\s*[:]*\s+(\d+).+(?:Episodes?)+\s*[:]*\s+(\d+(?:-\d+)?)\s*of\s*([\w?])", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private readonly Regex _tvTitleEngSeasonEpisodeRegex = new(@"Season\s*[:]*\s+(\d+).+(?:Episodes?)+\s*[:]*\s+(\d+(?:-\d+)?)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private readonly Regex _tvTitleEngSeasonRegex = new(@"Season\s*[:]*\s+(\d+(?:-\d+)?)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private readonly Regex _tvTitleEngEpisodeOfRegex = new(@"(?:Episodes?)+\s*[:]*\s+(\d+(?:-\d+)?)\s*of\s*([\w?])", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private readonly Regex _tvTitleEngEpisodeRegex = new(@"(?:Episodes?)+\s*[:]+\s*[:]*\s+(\d+(?:-\d+)?)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
|
||||
private readonly Regex _stripCyrillicRegex = new (@"(\([\p{IsCyrillic}\W]+\))|(^[\p{IsCyrillic}\W\d]+\/ )|([\p{IsCyrillic} \-]+,+)|([\p{IsCyrillic}]+)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private readonly Regex _stripCyrillicRegex = new(@"(\([\p{IsCyrillic}\W]+\))|(^[\p{IsCyrillic}\W\d]+\/ )|([\p{IsCyrillic} \-]+,+)|([\p{IsCyrillic}]+)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
|
||||
public string Parse(string title, ICollection<IndexerCategory> categories, bool stripCyrillicLetters = true)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ namespace NzbDrone.Core.Indexers.Definitions.TorrentPotato
|
|||
{
|
||||
public class TorrentPotatoParser : IParseIndexerResponse
|
||||
{
|
||||
private static readonly Regex RegexGuid = new (@"^magnet:\?xt=urn:btih:([a-f0-9]+)", RegexOptions.Compiled);
|
||||
private static readonly Regex RegexGuid = new(@"^magnet:\?xt=urn:btih:([a-f0-9]+)", RegexOptions.Compiled);
|
||||
|
||||
public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ public TorrentPotatoSettingsValidator()
|
|||
|
||||
public class TorrentPotatoSettings : ITorrentIndexerSettings
|
||||
{
|
||||
private static readonly TorrentPotatoSettingsValidator Validator = new ();
|
||||
private static readonly TorrentPotatoSettingsValidator Validator = new();
|
||||
|
||||
[FieldDefinition(0, Label = "API URL", HelpText = "URL to TorrentPotato API")]
|
||||
public string BaseUrl { get; set; }
|
||||
|
|
@ -31,10 +31,10 @@ public class TorrentPotatoSettings : ITorrentIndexerSettings
|
|||
public string Passkey { get; set; }
|
||||
|
||||
[FieldDefinition(20)]
|
||||
public IndexerBaseSettings BaseSettings { get; set; } = new ();
|
||||
public IndexerBaseSettings BaseSettings { get; set; } = new();
|
||||
|
||||
[FieldDefinition(21)]
|
||||
public IndexerTorrentBaseSettings TorrentBaseSettings { get; set; } = new ();
|
||||
public IndexerTorrentBaseSettings TorrentBaseSettings { get; set; } = new();
|
||||
|
||||
public virtual NzbDroneValidationResult Validate()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ public TorrentRssIndexerSettingsValidator()
|
|||
|
||||
public class TorrentRssIndexerSettings : ITorrentIndexerSettings
|
||||
{
|
||||
private static readonly TorrentRssIndexerSettingsValidator Validator = new ();
|
||||
private static readonly TorrentRssIndexerSettingsValidator Validator = new();
|
||||
|
||||
public TorrentRssIndexerSettings()
|
||||
{
|
||||
|
|
@ -38,10 +38,10 @@ public TorrentRssIndexerSettings()
|
|||
public double? DefaultReleaseSize { get; set; }
|
||||
|
||||
[FieldDefinition(20)]
|
||||
public IndexerBaseSettings BaseSettings { get; set; } = new ();
|
||||
public IndexerBaseSettings BaseSettings { get; set; } = new();
|
||||
|
||||
[FieldDefinition(21)]
|
||||
public IndexerTorrentBaseSettings TorrentBaseSettings { get; set; } = new ();
|
||||
public IndexerTorrentBaseSettings TorrentBaseSettings { get; set; } = new();
|
||||
|
||||
public NzbDroneValidationResult Validate()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -328,7 +328,7 @@ public TorrentSyndikatSettingsValidator()
|
|||
|
||||
public class TorrentSyndikatSettings : NoAuthTorrentBaseSettings
|
||||
{
|
||||
private static readonly TorrentSyndikatSettingsValidator Validator = new ();
|
||||
private static readonly TorrentSyndikatSettingsValidator Validator = new();
|
||||
|
||||
public TorrentSyndikatSettings()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -34,10 +34,10 @@ public TorznabSettingsValidator()
|
|||
|
||||
public class TorznabSettings : NewznabSettings, ITorrentIndexerSettings
|
||||
{
|
||||
private static readonly TorznabSettingsValidator Validator = new ();
|
||||
private static readonly TorznabSettingsValidator Validator = new();
|
||||
|
||||
[FieldDefinition(3)]
|
||||
public IndexerTorrentBaseSettings TorrentBaseSettings { get; set; } = new ();
|
||||
public IndexerTorrentBaseSettings TorrentBaseSettings { get; set; } = new();
|
||||
|
||||
public override NzbDroneValidationResult Validate()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ public Unit3dSettingsValidator()
|
|||
|
||||
public class Unit3dSettings : NoAuthTorrentBaseSettings
|
||||
{
|
||||
private static readonly Unit3dSettingsValidator Validator = new ();
|
||||
private static readonly Unit3dSettingsValidator Validator = new();
|
||||
|
||||
[FieldDefinition(2, Label = "ApiKey", HelpText = "Site API Key generated in My Security", Privacy = PrivacyLevel.ApiKey)]
|
||||
public string ApiKey { get; set; }
|
||||
|
|
|
|||
|
|
@ -290,7 +290,7 @@ public class XSpeedsParser : IParseIndexerResponse
|
|||
private readonly XSpeedsSettings _settings;
|
||||
private readonly IndexerCapabilitiesCategories _categories;
|
||||
|
||||
private readonly Regex _dateAddedRegex = new (@"\d{2}-\d{2}-\d{4} \d{2}:\d{2}", RegexOptions.Compiled);
|
||||
private readonly Regex _dateAddedRegex = new(@"\d{2}-\d{2}-\d{4} \d{2}:\d{2}", RegexOptions.Compiled);
|
||||
|
||||
public XSpeedsParser(XSpeedsSettings settings, IndexerCapabilitiesCategories categories)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ public class XthorSettingsValidator : NoAuthSettingsValidator<XthorSettings>
|
|||
|
||||
public class XthorSettings : NoAuthTorrentBaseSettings
|
||||
{
|
||||
private static readonly XthorSettingsValidator Validator = new ();
|
||||
private static readonly XthorSettingsValidator Validator = new();
|
||||
|
||||
public XthorSettings()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -29,6 +29,6 @@ public class IndexerDefinition : ProviderDefinition
|
|||
public int AppProfileId { get; set; }
|
||||
public LazyLoaded<AppSyncProfile> AppProfile { get; set; }
|
||||
|
||||
public List<SettingsField> ExtraFields { get; set; } = new ();
|
||||
public List<SettingsField> ExtraFields { get; set; } = new();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,12 +62,12 @@ public override bool Equals(object obj)
|
|||
return !Equals(left, right);
|
||||
}
|
||||
|
||||
public static IndexerFlag Internal => new ("internal", "Uploader is an internal release group");
|
||||
public static IndexerFlag Exclusive => new ("exclusive", "An exclusive release that must not be uploaded anywhere else");
|
||||
public static IndexerFlag FreeLeech => new ("freeleech", "Download doesn't count toward ratio");
|
||||
public static IndexerFlag NeutralLeech => new ("neutralleech", "Download and upload doesn't count toward ratio");
|
||||
public static IndexerFlag HalfLeech => new ("halfleech", "Release counts 50% to ratio");
|
||||
public static IndexerFlag Scene => new ("scene", "Uploader follows scene rules");
|
||||
public static IndexerFlag DoubleUpload => new ("doubleupload", "Seeding counts double for release");
|
||||
public static IndexerFlag Internal => new("internal", "Uploader is an internal release group");
|
||||
public static IndexerFlag Exclusive => new("exclusive", "An exclusive release that must not be uploaded anywhere else");
|
||||
public static IndexerFlag FreeLeech => new("freeleech", "Download doesn't count toward ratio");
|
||||
public static IndexerFlag NeutralLeech => new("neutralleech", "Download and upload doesn't count toward ratio");
|
||||
public static IndexerFlag HalfLeech => new("halfleech", "Release counts 50% to ratio");
|
||||
public static IndexerFlag Scene => new("scene", "Uploader follows scene rules");
|
||||
public static IndexerFlag DoubleUpload => new("doubleupload", "Seeding counts double for release");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ namespace NzbDrone.Core.Indexers
|
|||
{
|
||||
public static class MagnetLinkBuilder
|
||||
{
|
||||
private static readonly List<string> Trackers = new ()
|
||||
private static readonly List<string> Trackers = new()
|
||||
{
|
||||
"http://tracker.opentrackr.org:1337/announce",
|
||||
"udp://tracker.auctor.tv:6969/announce",
|
||||
|
|
|
|||
|
|
@ -5,90 +5,90 @@ namespace NzbDrone.Core.Indexers
|
|||
{
|
||||
public static class NewznabStandardCategory
|
||||
{
|
||||
public static readonly IndexerCategory ZedOther = new (0000, "Other");
|
||||
public static readonly IndexerCategory ZedOtherMisc = new (0010, "Other/Misc");
|
||||
public static readonly IndexerCategory ZedOtherHashed = new (0020, "Other/Hashed");
|
||||
public static readonly IndexerCategory ZedOther = new(0000, "Other");
|
||||
public static readonly IndexerCategory ZedOtherMisc = new(0010, "Other/Misc");
|
||||
public static readonly IndexerCategory ZedOtherHashed = new(0020, "Other/Hashed");
|
||||
|
||||
public static readonly IndexerCategory Console = new (1000, "Console");
|
||||
public static readonly IndexerCategory ConsoleNDS = new (1010, "Console/NDS");
|
||||
public static readonly IndexerCategory ConsolePSP = new (1020, "Console/PSP");
|
||||
public static readonly IndexerCategory ConsoleWii = new (1030, "Console/Wii");
|
||||
public static readonly IndexerCategory ConsoleXBox = new (1040, "Console/XBox");
|
||||
public static readonly IndexerCategory ConsoleXBox360 = new (1050, "Console/XBox 360");
|
||||
public static readonly IndexerCategory ConsoleWiiware = new (1060, "Console/Wiiware");
|
||||
public static readonly IndexerCategory ConsoleXBox360DLC = new (1070, "Console/XBox 360 DLC");
|
||||
public static readonly IndexerCategory ConsolePS3 = new (1080, "Console/PS3");
|
||||
public static readonly IndexerCategory ConsoleOther = new (1090, "Console/Other");
|
||||
public static readonly IndexerCategory Console3DS = new (1110, "Console/3DS");
|
||||
public static readonly IndexerCategory ConsolePSVita = new (1120, "Console/PS Vita");
|
||||
public static readonly IndexerCategory ConsoleWiiU = new (1130, "Console/WiiU");
|
||||
public static readonly IndexerCategory ConsoleXBoxOne = new (1140, "Console/XBox One");
|
||||
public static readonly IndexerCategory ConsolePS4 = new (1180, "Console/PS4");
|
||||
public static readonly IndexerCategory Console = new(1000, "Console");
|
||||
public static readonly IndexerCategory ConsoleNDS = new(1010, "Console/NDS");
|
||||
public static readonly IndexerCategory ConsolePSP = new(1020, "Console/PSP");
|
||||
public static readonly IndexerCategory ConsoleWii = new(1030, "Console/Wii");
|
||||
public static readonly IndexerCategory ConsoleXBox = new(1040, "Console/XBox");
|
||||
public static readonly IndexerCategory ConsoleXBox360 = new(1050, "Console/XBox 360");
|
||||
public static readonly IndexerCategory ConsoleWiiware = new(1060, "Console/Wiiware");
|
||||
public static readonly IndexerCategory ConsoleXBox360DLC = new(1070, "Console/XBox 360 DLC");
|
||||
public static readonly IndexerCategory ConsolePS3 = new(1080, "Console/PS3");
|
||||
public static readonly IndexerCategory ConsoleOther = new(1090, "Console/Other");
|
||||
public static readonly IndexerCategory Console3DS = new(1110, "Console/3DS");
|
||||
public static readonly IndexerCategory ConsolePSVita = new(1120, "Console/PS Vita");
|
||||
public static readonly IndexerCategory ConsoleWiiU = new(1130, "Console/WiiU");
|
||||
public static readonly IndexerCategory ConsoleXBoxOne = new(1140, "Console/XBox One");
|
||||
public static readonly IndexerCategory ConsolePS4 = new(1180, "Console/PS4");
|
||||
|
||||
public static readonly IndexerCategory Movies = new (2000, "Movies");
|
||||
public static readonly IndexerCategory MoviesForeign = new (2010, "Movies/Foreign");
|
||||
public static readonly IndexerCategory MoviesOther = new (2020, "Movies/Other");
|
||||
public static readonly IndexerCategory MoviesSD = new (2030, "Movies/SD");
|
||||
public static readonly IndexerCategory MoviesHD = new (2040, "Movies/HD");
|
||||
public static readonly IndexerCategory MoviesUHD = new (2045, "Movies/UHD");
|
||||
public static readonly IndexerCategory MoviesBluRay = new (2050, "Movies/BluRay");
|
||||
public static readonly IndexerCategory Movies3D = new (2060, "Movies/3D");
|
||||
public static readonly IndexerCategory MoviesDVD = new (2070, "Movies/DVD");
|
||||
public static readonly IndexerCategory MoviesWEBDL = new (2080, "Movies/WEB-DL");
|
||||
public static readonly IndexerCategory Moviesx265 = new (2090, "Movies/x265");
|
||||
public static readonly IndexerCategory Movies = new(2000, "Movies");
|
||||
public static readonly IndexerCategory MoviesForeign = new(2010, "Movies/Foreign");
|
||||
public static readonly IndexerCategory MoviesOther = new(2020, "Movies/Other");
|
||||
public static readonly IndexerCategory MoviesSD = new(2030, "Movies/SD");
|
||||
public static readonly IndexerCategory MoviesHD = new(2040, "Movies/HD");
|
||||
public static readonly IndexerCategory MoviesUHD = new(2045, "Movies/UHD");
|
||||
public static readonly IndexerCategory MoviesBluRay = new(2050, "Movies/BluRay");
|
||||
public static readonly IndexerCategory Movies3D = new(2060, "Movies/3D");
|
||||
public static readonly IndexerCategory MoviesDVD = new(2070, "Movies/DVD");
|
||||
public static readonly IndexerCategory MoviesWEBDL = new(2080, "Movies/WEB-DL");
|
||||
public static readonly IndexerCategory Moviesx265 = new(2090, "Movies/x265");
|
||||
|
||||
public static readonly IndexerCategory Audio = new (3000, "Audio");
|
||||
public static readonly IndexerCategory AudioMP3 = new (3010, "Audio/MP3");
|
||||
public static readonly IndexerCategory AudioVideo = new (3020, "Audio/Video");
|
||||
public static readonly IndexerCategory AudioAudiobook = new (3030, "Audio/Audiobook");
|
||||
public static readonly IndexerCategory AudioLossless = new (3040, "Audio/Lossless");
|
||||
public static readonly IndexerCategory AudioOther = new (3050, "Audio/Other");
|
||||
public static readonly IndexerCategory AudioForeign = new (3060, "Audio/Foreign");
|
||||
public static readonly IndexerCategory Audio = new(3000, "Audio");
|
||||
public static readonly IndexerCategory AudioMP3 = new(3010, "Audio/MP3");
|
||||
public static readonly IndexerCategory AudioVideo = new(3020, "Audio/Video");
|
||||
public static readonly IndexerCategory AudioAudiobook = new(3030, "Audio/Audiobook");
|
||||
public static readonly IndexerCategory AudioLossless = new(3040, "Audio/Lossless");
|
||||
public static readonly IndexerCategory AudioOther = new(3050, "Audio/Other");
|
||||
public static readonly IndexerCategory AudioForeign = new(3060, "Audio/Foreign");
|
||||
|
||||
public static readonly IndexerCategory PC = new (4000, "PC");
|
||||
public static readonly IndexerCategory PC0day = new (4010, "PC/0day");
|
||||
public static readonly IndexerCategory PCISO = new (4020, "PC/ISO");
|
||||
public static readonly IndexerCategory PCMac = new (4030, "PC/Mac");
|
||||
public static readonly IndexerCategory PCMobileOther = new (4040, "PC/Mobile-Other");
|
||||
public static readonly IndexerCategory PCGames = new (4050, "PC/Games");
|
||||
public static readonly IndexerCategory PCMobileiOS = new (4060, "PC/Mobile-iOS");
|
||||
public static readonly IndexerCategory PCMobileAndroid = new (4070, "PC/Mobile-Android");
|
||||
public static readonly IndexerCategory PC = new(4000, "PC");
|
||||
public static readonly IndexerCategory PC0day = new(4010, "PC/0day");
|
||||
public static readonly IndexerCategory PCISO = new(4020, "PC/ISO");
|
||||
public static readonly IndexerCategory PCMac = new(4030, "PC/Mac");
|
||||
public static readonly IndexerCategory PCMobileOther = new(4040, "PC/Mobile-Other");
|
||||
public static readonly IndexerCategory PCGames = new(4050, "PC/Games");
|
||||
public static readonly IndexerCategory PCMobileiOS = new(4060, "PC/Mobile-iOS");
|
||||
public static readonly IndexerCategory PCMobileAndroid = new(4070, "PC/Mobile-Android");
|
||||
|
||||
public static readonly IndexerCategory TV = new (5000, "TV");
|
||||
public static readonly IndexerCategory TVWEBDL = new (5010, "TV/WEB-DL");
|
||||
public static readonly IndexerCategory TVForeign = new (5020, "TV/Foreign");
|
||||
public static readonly IndexerCategory TVSD = new (5030, "TV/SD");
|
||||
public static readonly IndexerCategory TVHD = new (5040, "TV/HD");
|
||||
public static readonly IndexerCategory TVUHD = new (5045, "TV/UHD");
|
||||
public static readonly IndexerCategory TVOther = new (5050, "TV/Other");
|
||||
public static readonly IndexerCategory TVSport = new (5060, "TV/Sport");
|
||||
public static readonly IndexerCategory TVAnime = new (5070, "TV/Anime");
|
||||
public static readonly IndexerCategory TVDocumentary = new (5080, "TV/Documentary");
|
||||
public static readonly IndexerCategory TVx265 = new (5090, "TV/x265");
|
||||
public static readonly IndexerCategory TV = new(5000, "TV");
|
||||
public static readonly IndexerCategory TVWEBDL = new(5010, "TV/WEB-DL");
|
||||
public static readonly IndexerCategory TVForeign = new(5020, "TV/Foreign");
|
||||
public static readonly IndexerCategory TVSD = new(5030, "TV/SD");
|
||||
public static readonly IndexerCategory TVHD = new(5040, "TV/HD");
|
||||
public static readonly IndexerCategory TVUHD = new(5045, "TV/UHD");
|
||||
public static readonly IndexerCategory TVOther = new(5050, "TV/Other");
|
||||
public static readonly IndexerCategory TVSport = new(5060, "TV/Sport");
|
||||
public static readonly IndexerCategory TVAnime = new(5070, "TV/Anime");
|
||||
public static readonly IndexerCategory TVDocumentary = new(5080, "TV/Documentary");
|
||||
public static readonly IndexerCategory TVx265 = new(5090, "TV/x265");
|
||||
|
||||
public static readonly IndexerCategory XXX = new (6000, "XXX");
|
||||
public static readonly IndexerCategory XXXDVD = new (6010, "XXX/DVD");
|
||||
public static readonly IndexerCategory XXXWMV = new (6020, "XXX/WMV");
|
||||
public static readonly IndexerCategory XXXXviD = new (6030, "XXX/XviD");
|
||||
public static readonly IndexerCategory XXXx264 = new (6040, "XXX/x264");
|
||||
public static readonly IndexerCategory XXXUHD = new (6045, "XXX/UHD");
|
||||
public static readonly IndexerCategory XXXPack = new (6050, "XXX/Pack");
|
||||
public static readonly IndexerCategory XXXImageSet = new (6060, "XXX/ImageSet");
|
||||
public static readonly IndexerCategory XXXOther = new (6070, "XXX/Other");
|
||||
public static readonly IndexerCategory XXXSD = new (6080, "XXX/SD");
|
||||
public static readonly IndexerCategory XXXWEBDL = new (6090, "XXX/WEB-DL");
|
||||
public static readonly IndexerCategory XXX = new(6000, "XXX");
|
||||
public static readonly IndexerCategory XXXDVD = new(6010, "XXX/DVD");
|
||||
public static readonly IndexerCategory XXXWMV = new(6020, "XXX/WMV");
|
||||
public static readonly IndexerCategory XXXXviD = new(6030, "XXX/XviD");
|
||||
public static readonly IndexerCategory XXXx264 = new(6040, "XXX/x264");
|
||||
public static readonly IndexerCategory XXXUHD = new(6045, "XXX/UHD");
|
||||
public static readonly IndexerCategory XXXPack = new(6050, "XXX/Pack");
|
||||
public static readonly IndexerCategory XXXImageSet = new(6060, "XXX/ImageSet");
|
||||
public static readonly IndexerCategory XXXOther = new(6070, "XXX/Other");
|
||||
public static readonly IndexerCategory XXXSD = new(6080, "XXX/SD");
|
||||
public static readonly IndexerCategory XXXWEBDL = new(6090, "XXX/WEB-DL");
|
||||
|
||||
public static readonly IndexerCategory Books = new (7000, "Books");
|
||||
public static readonly IndexerCategory BooksMags = new (7010, "Books/Mags");
|
||||
public static readonly IndexerCategory BooksEBook = new (7020, "Books/EBook");
|
||||
public static readonly IndexerCategory BooksComics = new (7030, "Books/Comics");
|
||||
public static readonly IndexerCategory BooksTechnical = new (7040, "Books/Technical");
|
||||
public static readonly IndexerCategory BooksOther = new (7050, "Books/Other");
|
||||
public static readonly IndexerCategory BooksForeign = new (7060, "Books/Foreign");
|
||||
public static readonly IndexerCategory Books = new(7000, "Books");
|
||||
public static readonly IndexerCategory BooksMags = new(7010, "Books/Mags");
|
||||
public static readonly IndexerCategory BooksEBook = new(7020, "Books/EBook");
|
||||
public static readonly IndexerCategory BooksComics = new(7030, "Books/Comics");
|
||||
public static readonly IndexerCategory BooksTechnical = new(7040, "Books/Technical");
|
||||
public static readonly IndexerCategory BooksOther = new(7050, "Books/Other");
|
||||
public static readonly IndexerCategory BooksForeign = new(7060, "Books/Foreign");
|
||||
|
||||
public static readonly IndexerCategory Other = new (8000, "Other");
|
||||
public static readonly IndexerCategory OtherMisc = new (8010, "Other/Misc");
|
||||
public static readonly IndexerCategory OtherHashed = new (8020, "Other/Hashed");
|
||||
public static readonly IndexerCategory Other = new(8000, "Other");
|
||||
public static readonly IndexerCategory OtherMisc = new(8010, "Other/Misc");
|
||||
public static readonly IndexerCategory OtherHashed = new(8020, "Other/Hashed");
|
||||
|
||||
public static readonly IndexerCategory[] ParentCats =
|
||||
{
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ public CookieBaseSettingsValidator()
|
|||
|
||||
public class CookieTorrentBaseSettings : NoAuthTorrentBaseSettings
|
||||
{
|
||||
private static readonly CookieBaseSettingsValidator<CookieTorrentBaseSettings> Validator = new ();
|
||||
private static readonly CookieBaseSettingsValidator<CookieTorrentBaseSettings> Validator = new();
|
||||
|
||||
public CookieTorrentBaseSettings()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -16,16 +16,16 @@ public NoAuthSettingsValidator()
|
|||
|
||||
public class NoAuthTorrentBaseSettings : ITorrentIndexerSettings
|
||||
{
|
||||
private static readonly NoAuthSettingsValidator<NoAuthTorrentBaseSettings> Validator = new ();
|
||||
private static readonly NoAuthSettingsValidator<NoAuthTorrentBaseSettings> Validator = new();
|
||||
|
||||
[FieldDefinition(1, Label = "IndexerSettingsBaseUrl", Type = FieldType.Select, SelectOptionsProviderAction = "getUrls", HelpText = "IndexerSettingsBaseUrlHelpText")]
|
||||
public string BaseUrl { get; set; }
|
||||
|
||||
[FieldDefinition(20)]
|
||||
public IndexerBaseSettings BaseSettings { get; set; } = new ();
|
||||
public IndexerBaseSettings BaseSettings { get; set; } = new();
|
||||
|
||||
[FieldDefinition(21)]
|
||||
public IndexerTorrentBaseSettings TorrentBaseSettings { get; set; } = new ();
|
||||
public IndexerTorrentBaseSettings TorrentBaseSettings { get; set; } = new();
|
||||
|
||||
public virtual NzbDroneValidationResult Validate()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ public UserPassBaseSettingsValidator()
|
|||
|
||||
public class UserPassTorrentBaseSettings : NoAuthTorrentBaseSettings
|
||||
{
|
||||
private static readonly UserPassBaseSettingsValidator<UserPassTorrentBaseSettings> Validator = new ();
|
||||
private static readonly UserPassBaseSettingsValidator<UserPassTorrentBaseSettings> Validator = new();
|
||||
|
||||
public UserPassTorrentBaseSettings()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -106,7 +106,8 @@ public void PublishEvent<TEvent>(TEvent @event)
|
|||
_taskFactory.StartNew(() =>
|
||||
{
|
||||
handlerLocal.HandleAsync(@event);
|
||||
}, TaskCreationOptions.PreferFairness)
|
||||
},
|
||||
TaskCreationOptions.PreferFairness)
|
||||
.LogExceptions();
|
||||
}
|
||||
|
||||
|
|
@ -119,7 +120,8 @@ public void PublishEvent<TEvent>(TEvent @event)
|
|||
_logger.Trace("{0} ~> {1}", eventName, handlerLocal.GetType().Name);
|
||||
handlerLocal.HandleAsync(@event);
|
||||
_logger.Trace("{0} <~ {1}", eventName, handlerLocal.GetType().Name);
|
||||
}, TaskCreationOptions.PreferFairness)
|
||||
},
|
||||
TaskCreationOptions.PreferFairness)
|
||||
.LogExceptions();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ public AppriseSettingsValidator()
|
|||
|
||||
public class AppriseSettings : IProviderConfig
|
||||
{
|
||||
private static readonly AppriseSettingsValidator Validator = new ();
|
||||
private static readonly AppriseSettingsValidator Validator = new();
|
||||
|
||||
public AppriseSettings()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ public CustomScript(IConfigFileProvider configFileProvider,
|
|||
|
||||
public override string Link => "https://wiki.servarr.com/prowlarr/settings#connections";
|
||||
|
||||
public override ProviderMessage Message => new ("Testing will execute the script with the EventType set to Test, ensure your script handles this correctly", ProviderMessageType.Warning);
|
||||
public override ProviderMessage Message => new("Testing will execute the script with the EventType set to Test, ensure your script handles this correctly", ProviderMessageType.Warning);
|
||||
|
||||
public override void OnGrab(GrabMessage message)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -135,12 +135,12 @@ public override void OnApplicationUpdate(ApplicationUpdateMessage updateMessage)
|
|||
Color = (int)DiscordColors.Standard,
|
||||
Fields = new List<DiscordField>
|
||||
{
|
||||
new ()
|
||||
new()
|
||||
{
|
||||
Name = "Previous Version",
|
||||
Value = updateMessage.PreviousVersion.ToString()
|
||||
},
|
||||
new ()
|
||||
new()
|
||||
{
|
||||
Name = "New Version",
|
||||
Value = updateMessage.NewVersion.ToString()
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ public DiscordSettings()
|
|||
};
|
||||
}
|
||||
|
||||
private static readonly DiscordSettingsValidator Validator = new ();
|
||||
private static readonly DiscordSettingsValidator Validator = new();
|
||||
|
||||
[FieldDefinition(0, Label = "Webhook URL", HelpText = "Discord channel webhook url")]
|
||||
public string WebHookUrl { get; set; }
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ public PushcutSettingsValidator()
|
|||
|
||||
public class PushcutSettings : IProviderConfig
|
||||
{
|
||||
private static readonly PushcutSettingsValidator Validator = new ();
|
||||
private static readonly PushcutSettingsValidator Validator = new();
|
||||
|
||||
[FieldDefinition(0, Label = "Notification name", Type = FieldType.Textbox, HelpText = "Notification name from Notifications tab of the Pushcut app.")]
|
||||
public string NotificationName { get; set; }
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ public SignalSettingsValidator()
|
|||
|
||||
public class SignalSettings : IProviderConfig
|
||||
{
|
||||
private static readonly SignalSettingsValidator Validator = new ();
|
||||
private static readonly SignalSettingsValidator Validator = new();
|
||||
|
||||
[FieldDefinition(0, Label = "Host", Type = FieldType.Textbox, HelpText = "localhost")]
|
||||
public string Host { get; set; }
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ namespace NzbDrone.Core.Parser
|
|||
{
|
||||
public static class ParseUtil
|
||||
{
|
||||
private static readonly Regex ImdbIdRegex = new (@"^(?:tt)?(\d{1,8})$", RegexOptions.Compiled);
|
||||
private static readonly Regex ImdbIdRegex = new(@"^(?:tt)?(\d{1,8})$", RegexOptions.Compiled);
|
||||
|
||||
public static string NormalizeMultiSpaces(string s) =>
|
||||
new Regex(@"\s+").Replace(s.Trim(), " ");
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ namespace NzbDrone.Core.Parser
|
|||
{
|
||||
public static class TvCategoryFromQualityParser
|
||||
{
|
||||
private static readonly Regex SourceRegex = new (@"\b(?:
|
||||
private static readonly Regex SourceRegex = new(@"\b(?:
|
||||
(?<bluray>BluRay|Blu-Ray|HDDVD|BD)|
|
||||
(?<webdl>WEB[-_. ]DL|WEBDL|WebRip|iTunesHD|WebHD)|
|
||||
(?<hdtv>HDTV)|
|
||||
|
|
@ -19,16 +19,16 @@ public static class TvCategoryFromQualityParser
|
|||
)\b",
|
||||
RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace);
|
||||
|
||||
private static readonly Regex RawHdRegex = new (@"\b(?<rawhd>TrollHD|RawHD|1080i[-_. ]HDTV|Raw[-_. ]HD|MPEG[-_. ]?2)\b",
|
||||
private static readonly Regex RawHdRegex = new(@"\b(?<rawhd>TrollHD|RawHD|1080i[-_. ]HDTV|Raw[-_. ]HD|MPEG[-_. ]?2)\b",
|
||||
RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
|
||||
private static readonly Regex ResolutionRegex = new (@"\b(?:(?<q480p>480p|640x480|848x480)|(?<q576p>576p)|(?<q720p>720p|1280x720)|(?<q1080p>1080p|1920x1080)|(?<q2160p>2160p))\b",
|
||||
private static readonly Regex ResolutionRegex = new(@"\b(?:(?<q480p>480p|640x480|848x480)|(?<q576p>576p)|(?<q720p>720p|1280x720)|(?<q1080p>1080p|1920x1080)|(?<q2160p>2160p))\b",
|
||||
RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
|
||||
private static readonly Regex CodecRegex = new (@"\b(?:(?<x264>x264)|(?<h264>h264)|(?<xvidhd>XvidHD)|(?<xvid>Xvid)|(?<divx>divx))\b",
|
||||
private static readonly Regex CodecRegex = new(@"\b(?:(?<x264>x264)|(?<h264>h264)|(?<xvidhd>XvidHD)|(?<xvid>Xvid)|(?<divx>divx))\b",
|
||||
RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
|
||||
private static readonly Regex HighDefPdtvRegex = new (@"hr[-_. ]ws", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private static readonly Regex HighDefPdtvRegex = new(@"hr[-_. ]ws", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
|
||||
public static IndexerCategory ParseTvShowQuality(string tvShowFileName)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -260,7 +260,7 @@ private static IConfiguration GetConfiguration(StartupContext context)
|
|||
{
|
||||
return new ConfigurationBuilder()
|
||||
.AddXmlFile(configPath, optional: true, reloadOnChange: false)
|
||||
.AddInMemoryCollection(new List<KeyValuePair<string, string>> { new ("dataProtectionFolder", appFolder.GetDataProtectionPath()) })
|
||||
.AddInMemoryCollection(new List<KeyValuePair<string, string>> { new("dataProtectionFolder", appFolder.GetDataProtectionPath()) })
|
||||
.AddEnvironmentVariables()
|
||||
.Build();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ public abstract class IntegrationTest : IntegrationTestBase
|
|||
|
||||
protected int Port { get; private set; }
|
||||
|
||||
protected PostgresOptions PostgresOptions { get; set; } = new ();
|
||||
protected PostgresOptions PostgresOptions { get; set; } = new();
|
||||
|
||||
protected override string RootUrl => $"http://localhost:{Port}/";
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ namespace NzbDrone.Mono.Disk
|
|||
{
|
||||
public static class FindDriveType
|
||||
{
|
||||
private static readonly Dictionary<string, DriveType> DriveTypeMap = new ()
|
||||
private static readonly Dictionary<string, DriveType> DriveTypeMap = new()
|
||||
{
|
||||
{ "afpfs", DriveType.Network },
|
||||
{ "apfs", DriveType.Fixed },
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue