diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 8ec8715c2..876515c8e 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -141,9 +141,9 @@ - + all - runtime; build; native; contentfiles; analyzers + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/NzbDrone.Common.Test/Http/HttpClientFixture.cs b/src/NzbDrone.Common.Test/Http/HttpClientFixture.cs index 43620edf4..ccfcd95bc 100644 --- a/src/NzbDrone.Common.Test/Http/HttpClientFixture.cs +++ b/src/NzbDrone.Common.Test/Http/HttpClientFixture.cs @@ -35,7 +35,7 @@ public class HttpClientFixture : TestBase private string _httpBinHost; private string _httpBinHost2; - private System.Net.Http.HttpClient _httpClient = new (); + private System.Net.Http.HttpClient _httpClient = new(); [OneTimeSetUp] public void FixtureSetUp() diff --git a/src/NzbDrone.Common/Disk/OsPath.cs b/src/NzbDrone.Common/Disk/OsPath.cs index 30661d747..97099ca84 100644 --- a/src/NzbDrone.Common/Disk/OsPath.cs +++ b/src/NzbDrone.Common/Disk/OsPath.cs @@ -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() { diff --git a/src/NzbDrone.Common/Extensions/DictionaryExtensions.cs b/src/NzbDrone.Common/Extensions/DictionaryExtensions.cs index 7f0fe06ce..3bf3c0703 100644 --- a/src/NzbDrone.Common/Extensions/DictionaryExtensions.cs +++ b/src/NzbDrone.Common/Extensions/DictionaryExtensions.cs @@ -31,7 +31,7 @@ public static void Add(this ICollection } public static IDictionary SelectDictionary(this IDictionary dictionary, - Func, ValueTuple> selection) + Func, (TNewKey Item1, TNewValue Item2)> selection) { return dictionary.Select(selection).ToDictionary(t => t.Item1, t => t.Item2); } diff --git a/src/NzbDrone.Common/Http/CookieUtil.cs b/src/NzbDrone.Common/Http/CookieUtil.cs index ea408989a..74428ddcf 100644 --- a/src/NzbDrone.Common/Http/CookieUtil.cs +++ b/src/NzbDrone.Common/Http/CookieUtil.cs @@ -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' }; diff --git a/src/NzbDrone.Common/Http/HttpResponse.cs b/src/NzbDrone.Common/Http/HttpResponse.cs index 310955224..3e0e6e2a1 100644 --- a/src/NzbDrone.Common/Http/HttpResponse.cs +++ b/src/NzbDrone.Common/Http/HttpResponse.cs @@ -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) { diff --git a/src/NzbDrone.Common/Http/UserAgentParser.cs b/src/NzbDrone.Common/Http/UserAgentParser.cs index 8cc16e926..1c4527fab 100644 --- a/src/NzbDrone.Common/Http/UserAgentParser.cs +++ b/src/NzbDrone.Common/Http/UserAgentParser.cs @@ -5,7 +5,7 @@ namespace NzbDrone.Common.Http { public static class UserAgentParser { - private static readonly Regex AppSourceRegex = new (@"^(?[a-z0-9]+)(?:\/.+(?:\(.*\))?|$)", + private static readonly Regex AppSourceRegex = new(@"^(?[a-z0-9]+)(?:\/.+(?:\(.*\))?|$)", RegexOptions.IgnoreCase | RegexOptions.Compiled); public static string SimplifyUserAgent(string userAgent) diff --git a/src/NzbDrone.Common/Instrumentation/CleanseLogMessage.cs b/src/NzbDrone.Common/Instrumentation/CleanseLogMessage.cs index 393d6613a..cf78e64b5 100644 --- a/src/NzbDrone.Common/Instrumentation/CleanseLogMessage.cs +++ b/src/NzbDrone.Common/Instrumentation/CleanseLogMessage.cs @@ -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)=(?[^&=""]+?)(?=[ ""&=]|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase), - new (@"(?<=[?& ;])[^=]*?(_?(?[^&=]+?)(?= |&|$|;)", RegexOptions.Compiled | RegexOptions.IgnoreCase), - new (@"rss(24h)?\.torrentleech\.org/(?!rss)(?[0-9a-z]+)", RegexOptions.Compiled | RegexOptions.IgnoreCase), - new (@"torrentleech\.org/rss/download/[0-9]+/(?[0-9a-z]+)", RegexOptions.Compiled | RegexOptions.IgnoreCase), - new (@"iptorrents\.com/[/a-z0-9?&;]*?(?:[?&;](u|tp)=(?[^&=;]+?))+(?= |;|&|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase), - new (@"/fetch/[a-z0-9]{32}/(?[a-z0-9]{32})", RegexOptions.Compiled), - new (@"getnzb.*?(?<=\?|&)(r)=(?[^&=]+?)(?= |&|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase), - new (@"\b(\w*)?(_?(?[^&=]+?)(?= |&|$|;)", RegexOptions.Compiled | RegexOptions.IgnoreCase), - new (@"(?<=authkey = "")(?[^&=]+?)(?="")", RegexOptions.Compiled | RegexOptions.IgnoreCase), - new (@"(?<=beyond-hd\.[a-z]+/api/torrents/)(?[^&=][a-z0-9]+)", RegexOptions.Compiled | RegexOptions.IgnoreCase), - new (@"(?<=beyond-hd\.[a-z]+/torrent/download/[\w\d-]+[.]\d+[.])(?[a-z0-9]+)", RegexOptions.Compiled | RegexOptions.IgnoreCase), - new (@"(?:sharewood)\.[a-z]{2,3}/api/(?[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)=(?[^&=""]+?)(?=[ ""&=]|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase), + new(@"(?<=[?& ;])[^=]*?(_?(?[^&=]+?)(?= |&|$|;)", RegexOptions.Compiled | RegexOptions.IgnoreCase), + new(@"rss(24h)?\.torrentleech\.org/(?!rss)(?[0-9a-z]+)", RegexOptions.Compiled | RegexOptions.IgnoreCase), + new(@"torrentleech\.org/rss/download/[0-9]+/(?[0-9a-z]+)", RegexOptions.Compiled | RegexOptions.IgnoreCase), + new(@"iptorrents\.com/[/a-z0-9?&;]*?(?:[?&;](u|tp)=(?[^&=;]+?))+(?= |;|&|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase), + new(@"/fetch/[a-z0-9]{32}/(?[a-z0-9]{32})", RegexOptions.Compiled), + new(@"getnzb.*?(?<=\?|&)(r)=(?[^&=]+?)(?= |&|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase), + new(@"\b(\w*)?(_?(?[^&=]+?)(?= |&|$|;)", RegexOptions.Compiled | RegexOptions.IgnoreCase), + new(@"(?<=authkey = "")(?[^&=]+?)(?="")", RegexOptions.Compiled | RegexOptions.IgnoreCase), + new(@"(?<=beyond-hd\.[a-z]+/api/torrents/)(?[^&=][a-z0-9]+)", RegexOptions.Compiled | RegexOptions.IgnoreCase), + new(@"(?<=beyond-hd\.[a-z]+/torrent/download/[\w\d-]+[.]\d+[.])(?[a-z0-9]+)", RegexOptions.Compiled | RegexOptions.IgnoreCase), + new(@"(?:sharewood)\.[a-z]{2,3}/api/(?[a-z0-9]{16,})/", RegexOptions.Compiled | RegexOptions.IgnoreCase), // UNIT3D - new (@"(?<=[a-z0-9-]+\.[a-z]+/torrent/download/\d+\.)(?[^&=][a-z0-9]+)", RegexOptions.Compiled | RegexOptions.IgnoreCase), + new(@"(?<=[a-z0-9-]+\.[a-z]+/torrent/download/\d+\.)(?[^&=][a-z0-9]+)", RegexOptions.Compiled | RegexOptions.IgnoreCase), // Path - new (@"""C:\\Users\\(?[^\""]+?)(\\|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase), - new (@"""/(home|Users)/(?[^/""]+?)(/|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase), + new(@"""C:\\Users\\(?[^\""]+?)(\\|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase), + new(@"""/(home|Users)/(?[^/""]+?)(/|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase), // Trackers Announce Keys; Designed for Qbit Json; should work for all in theory - new (@"announce(\.php)?(/|%2f|%3fpasskey%3d)(?[a-z0-9]{16,})|(?[a-z0-9]{16,})(/|%2f)announce", RegexOptions.Compiled | RegexOptions.IgnoreCase), + new(@"announce(\.php)?(/|%2f|%3fpasskey%3d)(?[a-z0-9]{16,})|(?[a-z0-9]{16,})(/|%2f)announce", RegexOptions.Compiled | RegexOptions.IgnoreCase), // NzbGet - new (@"""Name""\s*:\s*""[^""]*(username|password)""\s*,\s*""Value""\s*:\s*""(?[^""]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase), + new(@"""Name""\s*:\s*""[^""]*(username|password)""\s*,\s*""Value""\s*:\s*""(?[^""]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase), // Sabnzbd - new (@"""[^""]*(username|password|api_?key|nzb_key)""\s*:\s*""(?[^""]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase), - new (@"""email_(account|to|from|pwd)""\s*:\s*""(?[^""]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase), + new(@"""[^""]*(username|password|api_?key|nzb_key)""\s*:\s*""(?[^""]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase), + new(@"""email_(account|to|from|pwd)""\s*:\s*""(?[^""]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase), // uTorrent - new (@"\[""[a-z._]*(username|password)"",\d,""(?[^""]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase), - new (@"\[""(boss_key|boss_key_salt|proxy\.proxy)"",\d,""(?[^""]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase), + new(@"\[""[a-z._]*(username|password)"",\d,""(?[^""]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase), + new(@"\[""(boss_key|boss_key_salt|proxy\.proxy)"",\d,""(?[^""]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase), // Deluge - new (@"auth.login\(""(?[^""]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase), + new(@"auth.login\(""(?[^""]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase), // BroadcastheNet (;torrent_pass|torrents_notify_ is for MTV) - new (@"""?method""?\s*:\s*""(getTorrents)"",\s*""?params""?\s*:\s*\[\s*""(?[^""]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase), - new (@"getTorrents\(""(?[^""]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase), - new (@"(?<=\?|&|;|=)(authkey|torrent_pass|torrents_notify)[_=](?[^&=]+?)(?=""|&|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase), + new(@"""?method""?\s*:\s*""(getTorrents)"",\s*""?params""?\s*:\s*\[\s*""(?[^""]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase), + new(@"getTorrents\(""(?[^""]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase), + new(@"(?<=\?|&|;|=)(authkey|torrent_pass|torrents_notify)[_=](?[^&=]+?)(?=""|&|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase), // Plex - new (@"(?<=\?|&)(X-Plex-Client-Identifier|X-Plex-Token)=(?[^&=]+?)(?= |&|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase), + new(@"(?<=\?|&)(X-Plex-Client-Identifier|X-Plex-Token)=(?[^&=]+?)(?= |&|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase), // Indexer Responses - new (@"(?:avistaz|exoticaz|cinemaz|privatehd)\.[a-z]{2,3}/rss/download/(?[^&=]+?)/(?[^&=]+?)\.torrent", RegexOptions.Compiled | RegexOptions.IgnoreCase), - new (@"(?:animebytes)\.[a-z]{2,3}/torrent/[0-9]+/download/(?[^&=]+?)[""]", RegexOptions.Compiled | RegexOptions.IgnoreCase), - new (@"""(info_hash|token|((pass|rss)[- _]?key))"":""(?[^&=]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase), + new(@"(?:avistaz|exoticaz|cinemaz|privatehd)\.[a-z]{2,3}/rss/download/(?[^&=]+?)/(?[^&=]+?)\.torrent", RegexOptions.Compiled | RegexOptions.IgnoreCase), + new(@"(?:animebytes)\.[a-z]{2,3}/torrent/[0-9]+/download/(?[^&=]+?)[""]", RegexOptions.Compiled | RegexOptions.IgnoreCase), + new(@"""(info_hash|token|((pass|rss)[- _]?key))"":""(?[^&=]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase), // Applications - new (@"""name"":""apikey"",""value"":""(?[^&=]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase), + new(@"""name"":""apikey"",""value"":""(?[^&=]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase), // Discord - new (@"discord.com/api/webhooks/((?[\w-]+)/)?(?[\w-]+)", RegexOptions.Compiled | RegexOptions.IgnoreCase) + new(@"discord.com/api/webhooks/((?[\w-]+)/)?(?[\w-]+)", RegexOptions.Compiled | RegexOptions.IgnoreCase) }; - private static readonly Regex CleanseRemoteIPRegex = new (@"(?:Auth-\w+(?Attempts to execute the specified task on the current thread. diff --git a/src/NzbDrone.Common/TPL/TaskExtensions.cs b/src/NzbDrone.Common/TPL/TaskExtensions.cs index 93b884732..616f8a3c6 100644 --- a/src/NzbDrone.Common/TPL/TaskExtensions.cs +++ b/src/NzbDrone.Common/TPL/TaskExtensions.cs @@ -20,7 +20,8 @@ public static Task LogExceptions(this Task task) Logger.Error(exception, "Task Error"); } } - }, TaskContinuationOptions.OnlyOnFaulted); + }, + TaskContinuationOptions.OnlyOnFaulted); return task; } diff --git a/src/NzbDrone.Core/Applications/ApplicationBase.cs b/src/NzbDrone.Core/Applications/ApplicationBase.cs index b4d32f054..a8fe95066 100644 --- a/src/NzbDrone.Core/Applications/ApplicationBase.cs +++ b/src/NzbDrone.Core/Applications/ApplicationBase.cs @@ -16,7 +16,7 @@ public abstract class ApplicationBase : IApplication protected readonly IAppIndexerMapService _appIndexerMapService; protected readonly Logger _logger; - protected static readonly Regex AppIndexerRegex = new (@"\/(?\d{1,3})(?:\/(?:api)?\/?)?$", RegexOptions.IgnoreCase | RegexOptions.Compiled); + protected static readonly Regex AppIndexerRegex = new(@"\/(?\d{1,3})(?:\/(?:api)?\/?)?$", RegexOptions.IgnoreCase | RegexOptions.Compiled); public abstract string Name { get; } diff --git a/src/NzbDrone.Core/Applications/LazyLibrarian/LazyLibrarianSettings.cs b/src/NzbDrone.Core/Applications/LazyLibrarian/LazyLibrarianSettings.cs index 9b2d17221..ec90d2adb 100644 --- a/src/NzbDrone.Core/Applications/LazyLibrarian/LazyLibrarianSettings.cs +++ b/src/NzbDrone.Core/Applications/LazyLibrarian/LazyLibrarianSettings.cs @@ -19,7 +19,7 @@ public LazyLibrarianSettingsValidator() public class LazyLibrarianSettings : IApplicationSettings { - private static readonly LazyLibrarianSettingsValidator Validator = new (); + private static readonly LazyLibrarianSettingsValidator Validator = new(); public LazyLibrarianSettings() { diff --git a/src/NzbDrone.Core/Applications/Lidarr/LidarrSettings.cs b/src/NzbDrone.Core/Applications/Lidarr/LidarrSettings.cs index 0197255a2..8d25519b1 100644 --- a/src/NzbDrone.Core/Applications/Lidarr/LidarrSettings.cs +++ b/src/NzbDrone.Core/Applications/Lidarr/LidarrSettings.cs @@ -18,7 +18,7 @@ public LidarrSettingsValidator() public class LidarrSettings : IApplicationSettings { - private static readonly LidarrSettingsValidator Validator = new (); + private static readonly LidarrSettingsValidator Validator = new(); public LidarrSettings() { diff --git a/src/NzbDrone.Core/Applications/Lidarr/LidarrV1Proxy.cs b/src/NzbDrone.Core/Applications/Lidarr/LidarrV1Proxy.cs index 3fcb337c0..3cc4114f0 100644 --- a/src/NzbDrone.Core/Applications/Lidarr/LidarrV1Proxy.cs +++ b/src/NzbDrone.Core/Applications/Lidarr/LidarrV1Proxy.cs @@ -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"; diff --git a/src/NzbDrone.Core/Applications/Mylar/MylarSettings.cs b/src/NzbDrone.Core/Applications/Mylar/MylarSettings.cs index f6f58b9e5..adb3223db 100644 --- a/src/NzbDrone.Core/Applications/Mylar/MylarSettings.cs +++ b/src/NzbDrone.Core/Applications/Mylar/MylarSettings.cs @@ -19,7 +19,7 @@ public MylarSettingsValidator() public class MylarSettings : IApplicationSettings { - private static readonly MylarSettingsValidator Validator = new (); + private static readonly MylarSettingsValidator Validator = new(); public MylarSettings() { diff --git a/src/NzbDrone.Core/Applications/Radarr/RadarrSettings.cs b/src/NzbDrone.Core/Applications/Radarr/RadarrSettings.cs index 457d7d0df..871e808d9 100644 --- a/src/NzbDrone.Core/Applications/Radarr/RadarrSettings.cs +++ b/src/NzbDrone.Core/Applications/Radarr/RadarrSettings.cs @@ -19,7 +19,7 @@ public RadarrSettingsValidator() public class RadarrSettings : IApplicationSettings { - private static readonly RadarrSettingsValidator Validator = new (); + private static readonly RadarrSettingsValidator Validator = new(); public RadarrSettings() { diff --git a/src/NzbDrone.Core/Applications/Radarr/RadarrV3Proxy.cs b/src/NzbDrone.Core/Applications/Radarr/RadarrV3Proxy.cs index d431856aa..3f3053f77 100644 --- a/src/NzbDrone.Core/Applications/Radarr/RadarrV3Proxy.cs +++ b/src/NzbDrone.Core/Applications/Radarr/RadarrV3Proxy.cs @@ -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"; diff --git a/src/NzbDrone.Core/Applications/Readarr/ReadarrSettings.cs b/src/NzbDrone.Core/Applications/Readarr/ReadarrSettings.cs index f789586d3..6eb4b6012 100644 --- a/src/NzbDrone.Core/Applications/Readarr/ReadarrSettings.cs +++ b/src/NzbDrone.Core/Applications/Readarr/ReadarrSettings.cs @@ -19,7 +19,7 @@ public ReadarrSettingsValidator() public class ReadarrSettings : IApplicationSettings { - private static readonly ReadarrSettingsValidator Validator = new (); + private static readonly ReadarrSettingsValidator Validator = new(); public ReadarrSettings() { diff --git a/src/NzbDrone.Core/Applications/Sonarr/SonarrSettings.cs b/src/NzbDrone.Core/Applications/Sonarr/SonarrSettings.cs index 95b52bab0..40c355b1f 100644 --- a/src/NzbDrone.Core/Applications/Sonarr/SonarrSettings.cs +++ b/src/NzbDrone.Core/Applications/Sonarr/SonarrSettings.cs @@ -18,7 +18,7 @@ public SonarrSettingsValidator() public class SonarrSettings : IApplicationSettings { - private static readonly SonarrSettingsValidator Validator = new (); + private static readonly SonarrSettingsValidator Validator = new(); public SonarrSettings() { diff --git a/src/NzbDrone.Core/Applications/Sonarr/SonarrV3Proxy.cs b/src/NzbDrone.Core/Applications/Sonarr/SonarrV3Proxy.cs index f92043c99..c0c9f1034 100644 --- a/src/NzbDrone.Core/Applications/Sonarr/SonarrV3Proxy.cs +++ b/src/NzbDrone.Core/Applications/Sonarr/SonarrV3Proxy.cs @@ -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"; diff --git a/src/NzbDrone.Core/Applications/Whisparr/WhisparrSettings.cs b/src/NzbDrone.Core/Applications/Whisparr/WhisparrSettings.cs index 0dfafc166..f5c39b989 100644 --- a/src/NzbDrone.Core/Applications/Whisparr/WhisparrSettings.cs +++ b/src/NzbDrone.Core/Applications/Whisparr/WhisparrSettings.cs @@ -19,7 +19,7 @@ public WhisparrSettingsValidator() public class WhisparrSettings : IApplicationSettings { - private static readonly WhisparrSettingsValidator Validator = new (); + private static readonly WhisparrSettingsValidator Validator = new(); public WhisparrSettings() { diff --git a/src/NzbDrone.Core/Datastore/DatabaseVersionParser.cs b/src/NzbDrone.Core/Datastore/DatabaseVersionParser.cs index ffc77cf18..81f727e16 100644 --- a/src/NzbDrone.Core/Datastore/DatabaseVersionParser.cs +++ b/src/NzbDrone.Core/Datastore/DatabaseVersionParser.cs @@ -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) { diff --git a/src/NzbDrone.Core/Download/Clients/FreeboxDownload/FreeboxDownloadSettings.cs b/src/NzbDrone.Core/Download/Clients/FreeboxDownload/FreeboxDownloadSettings.cs index effdf37d9..d5cdf167d 100644 --- a/src/NzbDrone.Core/Download/Clients/FreeboxDownload/FreeboxDownloadSettings.cs +++ b/src/NzbDrone.Core/Download/Clients/FreeboxDownload/FreeboxDownloadSettings.cs @@ -36,7 +36,7 @@ public FreeboxDownloadSettingsValidator() public class FreeboxDownloadSettings : IProviderConfig { - private static readonly FreeboxDownloadSettingsValidator Validator = new (); + private static readonly FreeboxDownloadSettingsValidator Validator = new(); public FreeboxDownloadSettings() { diff --git a/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrent.cs b/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrent.cs index 98ad41eec..6f7dcc6f3 100644 --- a/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrent.cs +++ b/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrent.cs @@ -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; diff --git a/src/NzbDrone.Core/Http/CloudFlare/CloudFlareDetectionService.cs b/src/NzbDrone.Core/Http/CloudFlare/CloudFlareDetectionService.cs index 8f38c032e..efb0e3332 100644 --- a/src/NzbDrone.Core/Http/CloudFlare/CloudFlareDetectionService.cs +++ b/src/NzbDrone.Core/Http/CloudFlare/CloudFlareDetectionService.cs @@ -10,7 +10,7 @@ namespace NzbDrone.Core.Http.CloudFlare { public class CloudFlareDetectionService { - private static readonly HashSet CloudflareServerNames = new () { "cloudflare", "cloudflare-nginx", "ddos-guard" }; + private static readonly HashSet CloudflareServerNames = new() { "cloudflare", "cloudflare-nginx", "ddos-guard" }; private readonly Logger _logger; public CloudFlareDetectionService(Logger logger) diff --git a/src/NzbDrone.Core/IndexerSearch/Definitions/SearchCriteriaBase.cs b/src/NzbDrone.Core/IndexerSearch/Definitions/SearchCriteriaBase.cs index 48e7586c5..15c4aa35b 100644 --- a/src/NzbDrone.Core/IndexerSearch/Definitions/SearchCriteriaBase.cs +++ b/src/NzbDrone.Core/IndexerSearch/Definitions/SearchCriteriaBase.cs @@ -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 IndexerIds { get; set; } diff --git a/src/NzbDrone.Core/IndexerSearch/NewznabRequest.cs b/src/NzbDrone.Core/IndexerSearch/NewznabRequest.cs index 442b7ba00..63ade87b5 100644 --- a/src/NzbDrone.Core/IndexerSearch/NewznabRequest.cs +++ b/src/NzbDrone.Core/IndexerSearch/NewznabRequest.cs @@ -5,10 +5,10 @@ namespace NzbDrone.Core.IndexerSearch { public class NewznabRequest { - private static readonly Regex TvRegex = new (@"\{((?:imdbid\:)(?[^{]+)|(?:rid\:)(?[^{]+)|(?:tvdbid\:)(?[^{]+)|(?:tmdbid\:)(?[^{]+)|(?:tvmazeid\:)(?[^{]+)|(?:doubanid\:)(?[^{]+)|(?:season\:)(?[^{]+)|(?:episode\:)(?[^{]+)|(?:year\:)(?[^{]+)|(?:genre\:)(?[^{]+))\}", RegexOptions.Compiled | RegexOptions.IgnoreCase); - private static readonly Regex MovieRegex = new (@"\{((?:imdbid\:)(?[^{]+)|(?:doubanid\:)(?[^{]+)|(?:tmdbid\:)(?[^{]+)|(?:traktid\:)(?[^{]+)|(?:year\:)(?[^{]+)|(?:genre\:)(?[^{]+))\}", RegexOptions.Compiled | RegexOptions.IgnoreCase); - private static readonly Regex MusicRegex = new (@"\{((?:artist\:)(?[^{]+)|(?:album\:)(?[^{]+)|(?:track\:)(?[^{]+)|(?:label\:)(?