diff --git a/src/NzbDrone.Common.Test/DiskTests/DiskTransferServiceFixture.cs b/src/NzbDrone.Common.Test/DiskTests/DiskTransferServiceFixture.cs index 04c5cb40a0..a8c42e2d38 100644 --- a/src/NzbDrone.Common.Test/DiskTests/DiskTransferServiceFixture.cs +++ b/src/NzbDrone.Common.Test/DiskTests/DiskTransferServiceFixture.cs @@ -922,7 +922,7 @@ private void WithMockMount(string root) .Returns(mock.Object); } - private void VerifyCopyFolder(string source, string destination) + private static void VerifyCopyFolder(string source, string destination) { var sourceFiles = Directory.GetFileSystemEntries(source, "*", SearchOption.AllDirectories).Select(v => v.Substring(source.Length + 1)).ToArray(); var destFiles = Directory.GetFileSystemEntries(destination, "*", SearchOption.AllDirectories).Select(v => v.Substring(destination.Length + 1)).ToArray(); @@ -930,7 +930,7 @@ private void VerifyCopyFolder(string source, string destination) CollectionAssert.AreEquivalent(sourceFiles, destFiles); } - private void VerifyMoveFolder(string source, string from, string destination) + private static void VerifyMoveFolder(string source, string from, string destination) { Directory.Exists(from).Should().BeFalse(); diff --git a/src/NzbDrone.Common.Test/InstrumentationTests/SentryTargetFixture.cs b/src/NzbDrone.Common.Test/InstrumentationTests/SentryTargetFixture.cs index 772efa6e33..a50fede80c 100644 --- a/src/NzbDrone.Common.Test/InstrumentationTests/SentryTargetFixture.cs +++ b/src/NzbDrone.Common.Test/InstrumentationTests/SentryTargetFixture.cs @@ -47,7 +47,7 @@ public void Setup() _subject = new SentryTarget("https://aaaaaaaaaaaaaaaaaaaaaaaaaa@sentry.io/111111", Mocker.GetMock().Object); } - private LogEventInfo GivenLogEvent(LogLevel level, Exception ex, string message) + private static LogEventInfo GivenLogEvent(LogLevel level, Exception ex, string message) { return LogEventInfo.Create(level, "SentryTest", ex, CultureInfo.InvariantCulture, message); } diff --git a/src/NzbDrone.Common.Test/PathExtensionFixture.cs b/src/NzbDrone.Common.Test/PathExtensionFixture.cs index 5a54eb7559..95385fa358 100644 --- a/src/NzbDrone.Common.Test/PathExtensionFixture.cs +++ b/src/NzbDrone.Common.Test/PathExtensionFixture.cs @@ -17,7 +17,7 @@ public class PathExtensionFixture : TestBase { private string _parent = @"C:\Test".AsOsAgnostic(); - private IAppFolderInfo GetIAppDirectoryInfo() + private static IAppFolderInfo GetIAppDirectoryInfo() { var fakeEnvironment = new Mock(); diff --git a/src/NzbDrone.Common/ArchiveService.cs b/src/NzbDrone.Common/ArchiveService.cs index b48605f49f..ff9e1651c7 100644 --- a/src/NzbDrone.Common/ArchiveService.cs +++ b/src/NzbDrone.Common/ArchiveService.cs @@ -189,7 +189,7 @@ private void ExtractZip(string compressedFile, string destination) } } - private void ExtractTgz(string compressedFile, string destination) + private static void ExtractTgz(string compressedFile, string destination) { Stream inStream = File.OpenRead(compressedFile); Stream gzipStream = new GZipInputStream(inStream); diff --git a/src/NzbDrone.Common/Disk/DiskProviderBase.cs b/src/NzbDrone.Common/Disk/DiskProviderBase.cs index e6a861f58c..0db6801fea 100644 --- a/src/NzbDrone.Common/Disk/DiskProviderBase.cs +++ b/src/NzbDrone.Common/Disk/DiskProviderBase.cs @@ -539,7 +539,7 @@ public virtual IMount GetMount(string path) } } - protected List GetDriveInfoMounts() + protected static List GetDriveInfoMounts() { return DriveInfo.GetDrives() .Where(d => d.IsReady) diff --git a/src/NzbDrone.Common/Disk/DiskTransferService.cs b/src/NzbDrone.Common/Disk/DiskTransferService.cs index f89c31b212..b63272bed8 100644 --- a/src/NzbDrone.Common/Disk/DiskTransferService.cs +++ b/src/NzbDrone.Common/Disk/DiskTransferService.cs @@ -464,7 +464,7 @@ private void RollbackCopy(string sourcePath, string targetPath) } } - private void WaitForIO() + private static void WaitForIO() { // This delay is intended to give the IO stack a bit of time to recover, this is especially required if remote NAS devices are involved. Thread.Sleep(3000); diff --git a/src/NzbDrone.Common/Http/HttpClient.cs b/src/NzbDrone.Common/Http/HttpClient.cs index fc06d43a22..56a1c5a433 100644 --- a/src/NzbDrone.Common/Http/HttpClient.cs +++ b/src/NzbDrone.Common/Http/HttpClient.cs @@ -377,7 +377,7 @@ public HttpResponse Post(HttpRequest request) return Task.Run(() => PostAsync(request)).GetAwaiter().GetResult(); } - private void CheckResponseContentType(HttpResponse response) + private static void CheckResponseContentType(HttpResponse response) { if (response.Headers.ContentType != null && response.Headers.ContentType.Contains("text/html")) { diff --git a/src/NzbDrone.Common/Http/JsonRpcRequestBuilder.cs b/src/NzbDrone.Common/Http/JsonRpcRequestBuilder.cs index 06b113e542..3d0b62c739 100644 --- a/src/NzbDrone.Common/Http/JsonRpcRequestBuilder.cs +++ b/src/NzbDrone.Common/Http/JsonRpcRequestBuilder.cs @@ -73,7 +73,7 @@ protected override void Apply(HttpRequest request) } } - private void ConvertParameter(object value, out object data, out string summary) + private static void ConvertParameter(object value, out object data, out string summary) { if (value is byte[]) { @@ -92,7 +92,7 @@ private void ConvertParameter(object value, out object data, out string summary) } } - public string CreateNextId() + public static string CreateNextId() { return Guid.NewGuid().ToString().Substring(0, 8); } diff --git a/src/NzbDrone.Common/Http/Proxy/ManagedWebProxyFactory.cs b/src/NzbDrone.Common/Http/Proxy/ManagedWebProxyFactory.cs index 7a972d84f5..a67a90f0c6 100644 --- a/src/NzbDrone.Common/Http/Proxy/ManagedWebProxyFactory.cs +++ b/src/NzbDrone.Common/Http/Proxy/ManagedWebProxyFactory.cs @@ -47,7 +47,7 @@ private IWebProxy CreateWebProxy(HttpProxySettings proxySettings) } } - private Uri GetProxyUri(HttpProxySettings proxySettings) + private static Uri GetProxyUri(HttpProxySettings proxySettings) { switch (proxySettings.Type) { diff --git a/src/NzbDrone.Common/Instrumentation/CleansingJsonVisitor.cs b/src/NzbDrone.Common/Instrumentation/CleansingJsonVisitor.cs index 34df2dff35..bf568ff875 100644 --- a/src/NzbDrone.Common/Instrumentation/CleansingJsonVisitor.cs +++ b/src/NzbDrone.Common/Instrumentation/CleansingJsonVisitor.cs @@ -34,7 +34,7 @@ public override void Visit(JProperty property) } } - private JValue CleanseValue(JValue value) + private static JValue CleanseValue(JValue value) { var text = value.Value(); var cleansed = CleanseLogMessage.Cleanse(text); diff --git a/src/NzbDrone.Common/Instrumentation/InitializeLogger.cs b/src/NzbDrone.Common/Instrumentation/InitializeLogger.cs index 038be8da8f..9408c646a1 100644 --- a/src/NzbDrone.Common/Instrumentation/InitializeLogger.cs +++ b/src/NzbDrone.Common/Instrumentation/InitializeLogger.cs @@ -19,7 +19,7 @@ public void Initialize() var sentryTarget = LogManager.Configuration.AllTargets.OfType().FirstOrDefault(); if (sentryTarget != null) { - sentryTarget.UpdateScope(_osInfo); + SentryTarget.UpdateScope(_osInfo); } } } diff --git a/src/NzbDrone.Common/Instrumentation/Sentry/SentryTarget.cs b/src/NzbDrone.Common/Instrumentation/Sentry/SentryTarget.cs index fd2fef61f0..f1f380d626 100644 --- a/src/NzbDrone.Common/Instrumentation/Sentry/SentryTarget.cs +++ b/src/NzbDrone.Common/Instrumentation/Sentry/SentryTarget.cs @@ -175,7 +175,7 @@ public void InitializeScope() }); } - public void UpdateScope(IOsInfo osInfo) + public static void UpdateScope(IOsInfo osInfo) { SentrySdk.ConfigureScope(scope => { @@ -183,7 +183,7 @@ public void UpdateScope(IOsInfo osInfo) }); } - public void UpdateScope(Version databaseVersion, int migration, string updateBranch, IPlatformInfo platformInfo) + public static void UpdateScope(Version databaseVersion, int migration, string updateBranch, IPlatformInfo platformInfo) { SentrySdk.ConfigureScope(scope => { diff --git a/src/NzbDrone.Core.Test/Datastore/Migration/147_custom_formatsFixture.cs b/src/NzbDrone.Core.Test/Datastore/Migration/147_custom_formatsFixture.cs index ce670f5eb0..68261ac523 100644 --- a/src/NzbDrone.Core.Test/Datastore/Migration/147_custom_formatsFixture.cs +++ b/src/NzbDrone.Core.Test/Datastore/Migration/147_custom_formatsFixture.cs @@ -132,7 +132,7 @@ private void ShouldHaveAddedDefaultFormat(IDirectDataMapper db) } } - private List QueryItems(IDirectDataMapper db) + private static List QueryItems(IDirectDataMapper db) { var test = db.Query("SELECT * FROM \"Profiles\""); diff --git a/src/NzbDrone.Core.Test/Datastore/Migration/149_regex_required_tagsFixture.cs b/src/NzbDrone.Core.Test/Datastore/Migration/149_regex_required_tagsFixture.cs index 55af2587e0..3faf4904c6 100644 --- a/src/NzbDrone.Core.Test/Datastore/Migration/149_regex_required_tagsFixture.cs +++ b/src/NzbDrone.Core.Test/Datastore/Migration/149_regex_required_tagsFixture.cs @@ -75,7 +75,7 @@ public void should_correctly_convert_multiple_formats() convertedTags2.Should().BeEquivalentTo("E_NRXRQ_Director"); } - private List QueryItems(IDirectDataMapper db) + private static List QueryItems(IDirectDataMapper db) { var items = db.Query("SELECT \"Name\", \"FormatTags\" FROM \"CustomFormats\""); diff --git a/src/NzbDrone.Core.Test/Datastore/Migration/150_fix_format_tags_double_underscoreFixture.cs b/src/NzbDrone.Core.Test/Datastore/Migration/150_fix_format_tags_double_underscoreFixture.cs index 21e7818a5a..3b9ebbc5c2 100644 --- a/src/NzbDrone.Core.Test/Datastore/Migration/150_fix_format_tags_double_underscoreFixture.cs +++ b/src/NzbDrone.Core.Test/Datastore/Migration/150_fix_format_tags_double_underscoreFixture.cs @@ -38,7 +38,7 @@ public void should_correctly_convert_format_tag(string original, string converte convertedTags.First().Should().BeEquivalentTo(converted); } - private List QueryItems(IDirectDataMapper db) + private static List QueryItems(IDirectDataMapper db) { var items = db.Query("SELECT \"Name\", \"FormatTags\" FROM \"CustomFormats\""); diff --git a/src/NzbDrone.Core.Test/Datastore/Migration/159_add_webrip_qualitiesFixture.cs b/src/NzbDrone.Core.Test/Datastore/Migration/159_add_webrip_qualitiesFixture.cs index c844df509d..60b434f18e 100644 --- a/src/NzbDrone.Core.Test/Datastore/Migration/159_add_webrip_qualitiesFixture.cs +++ b/src/NzbDrone.Core.Test/Datastore/Migration/159_add_webrip_qualitiesFixture.cs @@ -10,12 +10,12 @@ namespace NzbDrone.Core.Test.Datastore.Migration [TestFixture] public class add_webrip_qualitesFixture : MigrationTest { - private string GenerateQualityJson(int quality, bool allowed) + private static string GenerateQualityJson(int quality, bool allowed) { return $"{{ \"quality\": {quality}, \"allowed\": {allowed.ToString().ToLowerInvariant()} }}"; } - private string GenerateQualityGroupJson(int quality, bool allowed, string groupname, int group) + private static string GenerateQualityGroupJson(int quality, bool allowed, string groupname, int group) { return $"{{\"id\": {group}, \"name\": \"{groupname}\", \"items\": [ {{ \"quality\": {quality}, \"allowed\": {allowed.ToString().ToLowerInvariant()} }} ] }}"; } diff --git a/src/NzbDrone.Core.Test/Datastore/Migration/168_custom_format_rework.cs b/src/NzbDrone.Core.Test/Datastore/Migration/168_custom_format_rework.cs index 9c9e41471f..e7f86a6fc8 100644 --- a/src/NzbDrone.Core.Test/Datastore/Migration/168_custom_format_rework.cs +++ b/src/NzbDrone.Core.Test/Datastore/Migration/168_custom_format_rework.cs @@ -107,7 +107,7 @@ public void should_convert_custom_format_row_with_two_specs() json.Should().Contain($"\"name\": \"Edition 1\""); } - private void ValidateFormatTag(string json, string type, bool required, bool negated) + private static void ValidateFormatTag(string json, string type, bool required, bool negated) { json.Should().Contain($"\"type\": \"{type}\""); diff --git a/src/NzbDrone.Core.Test/Datastore/WhereBuilderPostgresFixture.cs b/src/NzbDrone.Core.Test/Datastore/WhereBuilderPostgresFixture.cs index 17b205e0e9..2546f665b4 100644 --- a/src/NzbDrone.Core.Test/Datastore/WhereBuilderPostgresFixture.cs +++ b/src/NzbDrone.Core.Test/Datastore/WhereBuilderPostgresFixture.cs @@ -22,12 +22,12 @@ public void MapTables() Mocker.Resolve(); } - private WhereBuilderPostgres Where(Expression> filter) + private static WhereBuilderPostgres Where(Expression> filter) { return new WhereBuilderPostgres(filter, true, 0); } - private WhereBuilderPostgres WhereMeta(Expression> filter) + private static WhereBuilderPostgres WhereMeta(Expression> filter) { return new WhereBuilderPostgres(filter, true, 0); } diff --git a/src/NzbDrone.Core.Test/Datastore/WhereBuilderSqliteFixture.cs b/src/NzbDrone.Core.Test/Datastore/WhereBuilderSqliteFixture.cs index 60d7b30f5c..7c2aed5fdf 100644 --- a/src/NzbDrone.Core.Test/Datastore/WhereBuilderSqliteFixture.cs +++ b/src/NzbDrone.Core.Test/Datastore/WhereBuilderSqliteFixture.cs @@ -22,12 +22,12 @@ public void MapTables() Mocker.Resolve(); } - private WhereBuilderSqlite Where(Expression> filter) + private static WhereBuilderSqlite Where(Expression> filter) { return new WhereBuilderSqlite(filter, true, 0); } - private WhereBuilderSqlite WhereMeta(Expression> filter) + private static WhereBuilderSqlite WhereMeta(Expression> filter) { return new WhereBuilderSqlite(filter, true, 0); } diff --git a/src/NzbDrone.Core.Test/Download/DownloadApprovedReportsTests/DownloadApprovedFixture.cs b/src/NzbDrone.Core.Test/Download/DownloadApprovedReportsTests/DownloadApprovedFixture.cs index 7f6da7b73e..f78114cf34 100644 --- a/src/NzbDrone.Core.Test/Download/DownloadApprovedReportsTests/DownloadApprovedFixture.cs +++ b/src/NzbDrone.Core.Test/Download/DownloadApprovedReportsTests/DownloadApprovedFixture.cs @@ -31,7 +31,7 @@ public void SetUp() .Returns>(v => v); } - private Movie GetMovie(int id) + private static Movie GetMovie(int id) { return Builder.CreateNew() .With(e => e.Id = id) diff --git a/src/NzbDrone.Core.Test/Framework/DirectDataMapper.cs b/src/NzbDrone.Core.Test/Framework/DirectDataMapper.cs index 2dd311cc29..e7eac45845 100644 --- a/src/NzbDrone.Core.Test/Framework/DirectDataMapper.cs +++ b/src/NzbDrone.Core.Test/Framework/DirectDataMapper.cs @@ -73,7 +73,7 @@ protected Dictionary MapToDictionary(DataRow dataRow) return item; } - protected T MapToObject(DataRow dataRow) + protected static T MapToObject(DataRow dataRow) where T : new() { var item = new T(); diff --git a/src/NzbDrone.Core.Test/Http/HttpProxySettingsProviderFixture.cs b/src/NzbDrone.Core.Test/Http/HttpProxySettingsProviderFixture.cs index 9345c24e6c..b8bfdf2558 100644 --- a/src/NzbDrone.Core.Test/Http/HttpProxySettingsProviderFixture.cs +++ b/src/NzbDrone.Core.Test/Http/HttpProxySettingsProviderFixture.cs @@ -11,7 +11,7 @@ namespace NzbDrone.Core.Test.Http [Platform(Exclude = "MacOsX")] public class HttpProxySettingsProviderFixture : TestBase { - private HttpProxySettings GetProxySettings() + private static HttpProxySettings GetProxySettings() { return new HttpProxySettings(ProxyType.Socks5, "localhost", 8080, "*.httpbin.org,google.com,172.16.0.0/12", true, null, null); } @@ -24,7 +24,7 @@ public void should_bypass_proxy(string url) { var settings = GetProxySettings(); - Subject.ShouldProxyBeBypassed(settings, new HttpUri(url)).Should().BeTrue(); + HttpProxySettingsProvider.ShouldProxyBeBypassed(settings, new HttpUri(url)).Should().BeTrue(); } [TestCase("http://bing.com/get")] @@ -33,7 +33,7 @@ public void should_not_bypass_proxy(string url) { var settings = GetProxySettings(); - Subject.ShouldProxyBeBypassed(settings, new HttpUri(url)).Should().BeFalse(); + HttpProxySettingsProvider.ShouldProxyBeBypassed(settings, new HttpUri(url)).Should().BeFalse(); } } } diff --git a/src/NzbDrone.Core.Test/ImportListTests/CouchPotato/CouchPotatoParserFixture.cs b/src/NzbDrone.Core.Test/ImportListTests/CouchPotato/CouchPotatoParserFixture.cs index 72c50abcf8..8f5325ac34 100644 --- a/src/NzbDrone.Core.Test/ImportListTests/CouchPotato/CouchPotatoParserFixture.cs +++ b/src/NzbDrone.Core.Test/ImportListTests/CouchPotato/CouchPotatoParserFixture.cs @@ -11,7 +11,7 @@ namespace NzbDrone.Core.Test.ImportList.CouchPotato { public class CouchPotatoTest : CoreTest { - private ImportListResponse CreateResponse(string url, string content) + private static ImportListResponse CreateResponse(string url, string content) { var httpRequest = new HttpRequest(url); var httpResponse = new HttpResponse(httpRequest, new HttpHeader(), Encoding.UTF8.GetBytes(content)); diff --git a/src/NzbDrone.Core.Test/ImportListTests/Plex/PlexParserFixture.cs b/src/NzbDrone.Core.Test/ImportListTests/Plex/PlexParserFixture.cs index 945d2717ba..04d997bffa 100644 --- a/src/NzbDrone.Core.Test/ImportListTests/Plex/PlexParserFixture.cs +++ b/src/NzbDrone.Core.Test/ImportListTests/Plex/PlexParserFixture.cs @@ -12,7 +12,7 @@ namespace NzbDrone.Core.Test.ImportList.Plex [TestFixture] public class PlexParserFixture : CoreTest { - private ImportListResponse CreateResponse(string url, string content) + private static ImportListResponse CreateResponse(string url, string content) { var httpRequest = new HttpRequest(url); var httpResponse = new HttpResponse(httpRequest, new HttpHeader(), Encoding.UTF8.GetBytes(content)); diff --git a/src/NzbDrone.Core.Test/ImportListTests/RSSImportParserFixture.cs b/src/NzbDrone.Core.Test/ImportListTests/RSSImportParserFixture.cs index 84019b7d72..6677d60305 100644 --- a/src/NzbDrone.Core.Test/ImportListTests/RSSImportParserFixture.cs +++ b/src/NzbDrone.Core.Test/ImportListTests/RSSImportParserFixture.cs @@ -11,7 +11,7 @@ namespace NzbDrone.Core.Test.ImportList { public class RSSImportTest : CoreTest { - private ImportListResponse CreateResponse(string url, string content) + private static ImportListResponse CreateResponse(string url, string content) { var httpRequest = new HttpRequest(url); var httpResponse = new HttpResponse(httpRequest, new HttpHeader(), Encoding.UTF8.GetBytes(content)); diff --git a/src/NzbDrone.Core.Test/IndexerTests/BasicRssParserFixture.cs b/src/NzbDrone.Core.Test/IndexerTests/BasicRssParserFixture.cs index 82120f8881..d65a3912ea 100644 --- a/src/NzbDrone.Core.Test/IndexerTests/BasicRssParserFixture.cs +++ b/src/NzbDrone.Core.Test/IndexerTests/BasicRssParserFixture.cs @@ -37,7 +37,7 @@ public void should_not_parse_size(string sizeString) result.Should().Be(0); } - private IndexerResponse CreateResponse(string url, string content) + private static IndexerResponse CreateResponse(string url, string content) { var httpRequest = new HttpRequest(url); var httpResponse = new HttpResponse(httpRequest, new HttpHeader(), Encoding.UTF8.GetBytes(content)); diff --git a/src/NzbDrone.Core.Test/IndexerTests/IntegrationTests/IndexerIntegrationTests.cs b/src/NzbDrone.Core.Test/IndexerTests/IntegrationTests/IndexerIntegrationTests.cs index c79bb8df77..4247badc61 100644 --- a/src/NzbDrone.Core.Test/IndexerTests/IntegrationTests/IndexerIntegrationTests.cs +++ b/src/NzbDrone.Core.Test/IndexerTests/IntegrationTests/IndexerIntegrationTests.cs @@ -42,7 +42,7 @@ private void ValidateTorrentResult(IList reports, bool hasSize = fa } } - private void ValidateResult(IList reports, bool hasSize = false, bool hasInfoUrl = false) + private static void ValidateResult(IList reports, bool hasSize = false, bool hasInfoUrl = false) { reports.Should().NotBeEmpty(); reports.Should().OnlyContain(c => c.Title.IsNotNullOrWhiteSpace()); diff --git a/src/NzbDrone.Core.Test/IndexerTests/TorrentRssIndexerTests/TestTorrentRssIndexer.cs b/src/NzbDrone.Core.Test/IndexerTests/TorrentRssIndexerTests/TestTorrentRssIndexer.cs index d969c5653e..82cb69e311 100644 --- a/src/NzbDrone.Core.Test/IndexerTests/TorrentRssIndexerTests/TestTorrentRssIndexer.cs +++ b/src/NzbDrone.Core.Test/IndexerTests/TorrentRssIndexerTests/TestTorrentRssIndexer.cs @@ -29,7 +29,7 @@ public List TestPublic() /// /// Code to quickly debug unit tests /// - private void SetupNLog() + private static void SetupNLog() { // Step 1. Create configuration object var config = new LoggingConfiguration(); diff --git a/src/NzbDrone.Core.Test/Messaging/Commands/CommandEqualityComparerFixture.cs b/src/NzbDrone.Core.Test/Messaging/Commands/CommandEqualityComparerFixture.cs index c27c060e6e..73f3ab45fc 100644 --- a/src/NzbDrone.Core.Test/Messaging/Commands/CommandEqualityComparerFixture.cs +++ b/src/NzbDrone.Core.Test/Messaging/Commands/CommandEqualityComparerFixture.cs @@ -19,7 +19,7 @@ namespace NzbDrone.Core.Test.Messaging.Commands [TestFixture] public class CommandEqualityComparerFixture { - private string GivenRandomPath() + private static string GivenRandomPath() { return Path.Combine(@"C:\Tesst\", Guid.NewGuid().ToString()).AsOsAgnostic(); } diff --git a/src/NzbDrone.Core.Test/MetadataSource/SkyHook/SkyHookProxyFixture.cs b/src/NzbDrone.Core.Test/MetadataSource/SkyHook/SkyHookProxyFixture.cs index b0a2676140..4d1c66cd91 100644 --- a/src/NzbDrone.Core.Test/MetadataSource/SkyHook/SkyHookProxyFixture.cs +++ b/src/NzbDrone.Core.Test/MetadataSource/SkyHook/SkyHookProxyFixture.cs @@ -30,7 +30,7 @@ public void should_be_able_to_get_movie_detail(int tmdbId, string title) details.Title.Should().Be(title); } - private void ValidateMovie(MovieMetadata movie) + private static void ValidateMovie(MovieMetadata movie) { movie.Should().NotBeNull(); movie.Title.Should().NotBeNullOrWhiteSpace(); diff --git a/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs index 019f7d157b..6059d6b752 100644 --- a/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs @@ -515,7 +515,7 @@ public void should_be_able_to_parse_repack(string title, bool isRepack, int vers result.Revision.IsRepack.Should().Be(isRepack); } - private void ParseAndVerifyQuality(string title, QualitySource source, bool proper, Resolution resolution, Modifier modifier = Modifier.NONE) + private static void ParseAndVerifyQuality(string title, QualitySource source, bool proper, Resolution resolution, Modifier modifier = Modifier.NONE) { var result = QualityParser.ParseQuality(title); if (resolution != Resolution.Unknown) diff --git a/src/NzbDrone.Core/Authentication/UserService.cs b/src/NzbDrone.Core/Authentication/UserService.cs index 2a5cb54634..8281e6c8f8 100644 --- a/src/NzbDrone.Core/Authentication/UserService.cs +++ b/src/NzbDrone.Core/Authentication/UserService.cs @@ -133,7 +133,7 @@ private User SetUserHashedPassword(User user, string password) return user; } - private byte[] GenerateSalt() + private static byte[] GenerateSalt() { var salt = new byte[SALT_SIZE]; RandomNumberGenerator.Create().GetBytes(salt); @@ -141,7 +141,7 @@ private byte[] GenerateSalt() return salt; } - private string GetHashedPassword(string password, byte[] salt, int iterations) + private static string GetHashedPassword(string password, byte[] salt, int iterations) { return Convert.ToBase64String(KeyDerivation.Pbkdf2( password: password, diff --git a/src/NzbDrone.Core/Blocklisting/BlocklistService.cs b/src/NzbDrone.Core/Blocklisting/BlocklistService.cs index 33a7d9be04..c9c59f5ee9 100644 --- a/src/NzbDrone.Core/Blocklisting/BlocklistService.cs +++ b/src/NzbDrone.Core/Blocklisting/BlocklistService.cs @@ -139,7 +139,7 @@ private bool SameTorrent(Blocklist item, TorrentInfo release) return HasSameIndexer(item, release.Indexer); } - private bool HasSameIndexer(Blocklist item, string indexer) + private static bool HasSameIndexer(Blocklist item, string indexer) { if (item.Indexer.IsNullOrWhiteSpace()) { @@ -149,7 +149,7 @@ private bool HasSameIndexer(Blocklist item, string indexer) return item.Indexer.Equals(indexer, StringComparison.InvariantCultureIgnoreCase); } - private bool HasSamePublishedDate(Blocklist item, DateTime publishedDate) + private static bool HasSamePublishedDate(Blocklist item, DateTime publishedDate) { if (!item.PublishedDate.HasValue) { @@ -160,7 +160,7 @@ private bool HasSamePublishedDate(Blocklist item, DateTime publishedDate) item.PublishedDate.Value.AddMinutes(2) >= publishedDate; } - private bool HasSameSize(Blocklist item, long size) + private static bool HasSameSize(Blocklist item, long size) { if (!item.Size.HasValue) { diff --git a/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs b/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs index 8b3b2aaa6e..4f6953a21e 100644 --- a/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs +++ b/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs @@ -477,7 +477,7 @@ private void SaveConfigFile(XDocument xDoc) } } - private string GenerateApiKey() + private static string GenerateApiKey() { return Guid.NewGuid().ToString().Replace("-", ""); } diff --git a/src/NzbDrone.Core/Datastore/BasicRepository.cs b/src/NzbDrone.Core/Datastore/BasicRepository.cs index 0cb488dfa5..77764e1bf0 100644 --- a/src/NzbDrone.Core/Datastore/BasicRepository.cs +++ b/src/NzbDrone.Core/Datastore/BasicRepository.cs @@ -433,7 +433,7 @@ public virtual PagingSpec GetPaged(PagingSpec pagingSpec) return pagingSpec; } - protected void AddFilters(SqlBuilder builder, PagingSpec pagingSpec) + protected static void AddFilters(SqlBuilder builder, PagingSpec pagingSpec) { var filters = pagingSpec.FilterExpressions; diff --git a/src/NzbDrone.Core/Datastore/Converters/AutoTagSpecificationConverter.cs b/src/NzbDrone.Core/Datastore/Converters/AutoTagSpecificationConverter.cs index 3f237bc3f4..f21d87bb03 100644 --- a/src/NzbDrone.Core/Datastore/Converters/AutoTagSpecificationConverter.cs +++ b/src/NzbDrone.Core/Datastore/Converters/AutoTagSpecificationConverter.cs @@ -77,7 +77,7 @@ public override List Read(ref Utf8JsonReader reader, } // Helper function for validating where you are in the JSON - private void ValidateToken(Utf8JsonReader reader, JsonTokenType tokenType) + private static void ValidateToken(Utf8JsonReader reader, JsonTokenType tokenType) { if (reader.TokenType != tokenType) { diff --git a/src/NzbDrone.Core/Datastore/Converters/CustomFormatSpecificationConverter.cs b/src/NzbDrone.Core/Datastore/Converters/CustomFormatSpecificationConverter.cs index 671b951ff4..bf73c1d2b3 100644 --- a/src/NzbDrone.Core/Datastore/Converters/CustomFormatSpecificationConverter.cs +++ b/src/NzbDrone.Core/Datastore/Converters/CustomFormatSpecificationConverter.cs @@ -76,7 +76,7 @@ public override List Read(ref Utf8JsonReader reader, } // Helper function for validating where you are in the JSON - private void ValidateToken(Utf8JsonReader reader, JsonTokenType tokenType) + private static void ValidateToken(Utf8JsonReader reader, JsonTokenType tokenType) { if (reader.TokenType != tokenType) { diff --git a/src/NzbDrone.Core/Datastore/ExpressionVisitor.cs b/src/NzbDrone.Core/Datastore/ExpressionVisitor.cs index 2321e631be..87acd43e8a 100644 --- a/src/NzbDrone.Core/Datastore/ExpressionVisitor.cs +++ b/src/NzbDrone.Core/Datastore/ExpressionVisitor.cs @@ -140,7 +140,7 @@ protected virtual Expression VisitLamda(LambdaExpression lambdaExpression) return lambdaExpression; } - private Expression VisitParameter(ParameterExpression expression) + private static Expression VisitParameter(ParameterExpression expression) { return expression; } diff --git a/src/NzbDrone.Core/Datastore/Migration/109_add_movie_formats_to_naming_config.cs b/src/NzbDrone.Core/Datastore/Migration/109_add_movie_formats_to_naming_config.cs index 3750e59631..3d34e5dee6 100644 --- a/src/NzbDrone.Core/Datastore/Migration/109_add_movie_formats_to_naming_config.cs +++ b/src/NzbDrone.Core/Datastore/Migration/109_add_movie_formats_to_naming_config.cs @@ -15,7 +15,7 @@ protected override void MainDbUpgrade() Execute.WithConnection(ConvertConfig); } - private void ConvertConfig(IDbConnection conn, IDbTransaction tran) + private static void ConvertConfig(IDbConnection conn, IDbTransaction tran) { using (var namingConfigCmd = conn.CreateCommand()) { diff --git a/src/NzbDrone.Core/Datastore/Migration/115_update_movie_sorttitle.cs b/src/NzbDrone.Core/Datastore/Migration/115_update_movie_sorttitle.cs index 341c4365bf..1f77fd0e7f 100644 --- a/src/NzbDrone.Core/Datastore/Migration/115_update_movie_sorttitle.cs +++ b/src/NzbDrone.Core/Datastore/Migration/115_update_movie_sorttitle.cs @@ -13,7 +13,7 @@ protected override void MainDbUpgrade() Execute.WithConnection(SetSortTitles); } - private void SetSortTitles(IDbConnection conn, IDbTransaction tran) + private static void SetSortTitles(IDbConnection conn, IDbTransaction tran) { using (var getSeriesCmd = conn.CreateCommand()) { diff --git a/src/NzbDrone.Core/Datastore/Migration/116_update_movie_sorttitle_again.cs b/src/NzbDrone.Core/Datastore/Migration/116_update_movie_sorttitle_again.cs index 5a92860540..b3a820f646 100644 --- a/src/NzbDrone.Core/Datastore/Migration/116_update_movie_sorttitle_again.cs +++ b/src/NzbDrone.Core/Datastore/Migration/116_update_movie_sorttitle_again.cs @@ -12,7 +12,7 @@ protected override void MainDbUpgrade() Execute.WithConnection(SetSortTitles); } - private void SetSortTitles(IDbConnection conn, IDbTransaction tran) + private static void SetSortTitles(IDbConnection conn, IDbTransaction tran) { using (var getSeriesCmd = conn.CreateCommand()) { diff --git a/src/NzbDrone.Core/Datastore/Migration/117_update_movie_file.cs b/src/NzbDrone.Core/Datastore/Migration/117_update_movie_file.cs index 72d9ff8d35..77063cc359 100644 --- a/src/NzbDrone.Core/Datastore/Migration/117_update_movie_file.cs +++ b/src/NzbDrone.Core/Datastore/Migration/117_update_movie_file.cs @@ -14,7 +14,7 @@ protected override void MainDbUpgrade() // Execute.WithConnection(SetSortTitles); } - private void SetSortTitles(IDbConnection conn, IDbTransaction tran) + private static void SetSortTitles(IDbConnection conn, IDbTransaction tran) { using (var getSeriesCmd = conn.CreateCommand()) { diff --git a/src/NzbDrone.Core/Datastore/Migration/118_update_movie_slug.cs b/src/NzbDrone.Core/Datastore/Migration/118_update_movie_slug.cs index 101751b0a0..0bbddebe0d 100644 --- a/src/NzbDrone.Core/Datastore/Migration/118_update_movie_slug.cs +++ b/src/NzbDrone.Core/Datastore/Migration/118_update_movie_slug.cs @@ -12,7 +12,7 @@ protected override void MainDbUpgrade() Execute.WithConnection(SetTitleSlug); } - private void SetTitleSlug(IDbConnection conn, IDbTransaction tran) + private static void SetTitleSlug(IDbConnection conn, IDbTransaction tran) { using (var getSeriesCmd = conn.CreateCommand()) { diff --git a/src/NzbDrone.Core/Datastore/Migration/121_update_filedate_config.cs b/src/NzbDrone.Core/Datastore/Migration/121_update_filedate_config.cs index 19410440e9..eb7b435f42 100644 --- a/src/NzbDrone.Core/Datastore/Migration/121_update_filedate_config.cs +++ b/src/NzbDrone.Core/Datastore/Migration/121_update_filedate_config.cs @@ -14,7 +14,7 @@ protected override void MainDbUpgrade() Execute.WithConnection(SetTitleSlug); } - private void SetTitleSlug(IDbConnection conn, IDbTransaction tran) + private static void SetTitleSlug(IDbConnection conn, IDbTransaction tran) { using (var getSeriesCmd = conn.CreateCommand()) { diff --git a/src/NzbDrone.Core/Datastore/Migration/125_fix_imdb_unique.cs b/src/NzbDrone.Core/Datastore/Migration/125_fix_imdb_unique.cs index d93f468620..15e59e7957 100644 --- a/src/NzbDrone.Core/Datastore/Migration/125_fix_imdb_unique.cs +++ b/src/NzbDrone.Core/Datastore/Migration/125_fix_imdb_unique.cs @@ -12,7 +12,7 @@ protected override void MainDbUpgrade() Execute.WithConnection(DeleteUniqueIndex); } - private void DeleteUniqueIndex(IDbConnection conn, IDbTransaction tran) + private static void DeleteUniqueIndex(IDbConnection conn, IDbTransaction tran) { using (var getSeriesCmd = conn.CreateCommand()) { diff --git a/src/NzbDrone.Core/Datastore/Migration/126_update_qualities_and_profiles.cs b/src/NzbDrone.Core/Datastore/Migration/126_update_qualities_and_profiles.cs index f7eff5fb5b..aa018f707e 100644 --- a/src/NzbDrone.Core/Datastore/Migration/126_update_qualities_and_profiles.cs +++ b/src/NzbDrone.Core/Datastore/Migration/126_update_qualities_and_profiles.cs @@ -15,7 +15,7 @@ protected override void MainDbUpgrade() Execute.WithConnection(ConvertProfile); } - private void ConvertProfile(IDbConnection conn, IDbTransaction tran) + private static void ConvertProfile(IDbConnection conn, IDbTransaction tran) { var updater = new ProfileUpdater125(conn, tran); updater.SplitQualityAppend(0, 27); // TELECINE AFTER Unknown diff --git a/src/NzbDrone.Core/Datastore/Migration/134_add_remux_qualities_for_the_wankers.cs b/src/NzbDrone.Core/Datastore/Migration/134_add_remux_qualities_for_the_wankers.cs index 0dfbc7f9f2..f977e8ae3b 100644 --- a/src/NzbDrone.Core/Datastore/Migration/134_add_remux_qualities_for_the_wankers.cs +++ b/src/NzbDrone.Core/Datastore/Migration/134_add_remux_qualities_for_the_wankers.cs @@ -12,7 +12,7 @@ protected override void MainDbUpgrade() Execute.WithConnection(ConvertProfile); } - private void ConvertProfile(IDbConnection conn, IDbTransaction tran) + private static void ConvertProfile(IDbConnection conn, IDbTransaction tran) { var updater = new ProfileUpdater125(conn, tran); updater.SplitQualityAppend(19, 31); // Remux2160p AFTER Bluray2160p diff --git a/src/NzbDrone.Core/Datastore/Migration/137_add_import_exclusions_table.cs b/src/NzbDrone.Core/Datastore/Migration/137_add_import_exclusions_table.cs index e54847d359..b9f95532cb 100644 --- a/src/NzbDrone.Core/Datastore/Migration/137_add_import_exclusions_table.cs +++ b/src/NzbDrone.Core/Datastore/Migration/137_add_import_exclusions_table.cs @@ -24,7 +24,7 @@ protected override void MainDbUpgrade() Execute.WithConnection(AddExisting); } - private void AddExisting(IDbConnection conn, IDbTransaction tran) + private static void AddExisting(IDbConnection conn, IDbTransaction tran) { using (var getSeriesCmd = conn.CreateCommand()) { diff --git a/src/NzbDrone.Core/Datastore/Migration/139_fix_indexer_baseurl.cs b/src/NzbDrone.Core/Datastore/Migration/139_fix_indexer_baseurl.cs index 1f24b03fe5..ccea74f54a 100644 --- a/src/NzbDrone.Core/Datastore/Migration/139_fix_indexer_baseurl.cs +++ b/src/NzbDrone.Core/Datastore/Migration/139_fix_indexer_baseurl.cs @@ -15,7 +15,7 @@ protected override void MainDbUpgrade() Execute.WithConnection(RenameUrlToBaseUrl); } - private void RenameUrlToBaseUrl(IDbConnection conn, IDbTransaction tran) + private static void RenameUrlToBaseUrl(IDbConnection conn, IDbTransaction tran) { using (var cmd = conn.CreateCommand()) { diff --git a/src/NzbDrone.Core/Datastore/Migration/141_fix_duplicate_alt_titles.cs b/src/NzbDrone.Core/Datastore/Migration/141_fix_duplicate_alt_titles.cs index e58cdff786..3c38c38d19 100644 --- a/src/NzbDrone.Core/Datastore/Migration/141_fix_duplicate_alt_titles.cs +++ b/src/NzbDrone.Core/Datastore/Migration/141_fix_duplicate_alt_titles.cs @@ -13,7 +13,7 @@ protected override void MainDbUpgrade() Alter.Table("AlternativeTitles").AlterColumn("CleanTitle").AsString().Unique(); } - private void RemoveDuplicateAlternateTitles(IDbConnection conn, IDbTransaction tran) + private static void RemoveDuplicateAlternateTitles(IDbConnection conn, IDbTransaction tran) { using (var cmd = conn.CreateCommand()) { diff --git a/src/NzbDrone.Core/Datastore/Migration/149_convert_regex_required_tags.cs b/src/NzbDrone.Core/Datastore/Migration/149_convert_regex_required_tags.cs index 5f6259e251..043b21d3aa 100644 --- a/src/NzbDrone.Core/Datastore/Migration/149_convert_regex_required_tags.cs +++ b/src/NzbDrone.Core/Datastore/Migration/149_convert_regex_required_tags.cs @@ -18,7 +18,7 @@ protected override void MainDbUpgrade() Execute.WithConnection(ConvertExistingFormatTags); } - private void ConvertExistingFormatTags(IDbConnection conn, IDbTransaction tran) + private static void ConvertExistingFormatTags(IDbConnection conn, IDbTransaction tran) { var updater = new CustomFormatUpdater149(conn, tran); diff --git a/src/NzbDrone.Core/Datastore/Migration/150_fix_format_tags_double_underscore.cs b/src/NzbDrone.Core/Datastore/Migration/150_fix_format_tags_double_underscore.cs index 90408d095e..6cd28c168b 100644 --- a/src/NzbDrone.Core/Datastore/Migration/150_fix_format_tags_double_underscore.cs +++ b/src/NzbDrone.Core/Datastore/Migration/150_fix_format_tags_double_underscore.cs @@ -15,7 +15,7 @@ protected override void MainDbUpgrade() Execute.WithConnection(ConvertExistingFormatTags); } - private void ConvertExistingFormatTags(IDbConnection conn, IDbTransaction tran) + private static void ConvertExistingFormatTags(IDbConnection conn, IDbTransaction tran) { var updater = new CustomFormatUpdater149(conn, tran); diff --git a/src/NzbDrone.Core/Datastore/Migration/156_add_download_client_priority.cs b/src/NzbDrone.Core/Datastore/Migration/156_add_download_client_priority.cs index 3428406ebf..316511793f 100644 --- a/src/NzbDrone.Core/Datastore/Migration/156_add_download_client_priority.cs +++ b/src/NzbDrone.Core/Datastore/Migration/156_add_download_client_priority.cs @@ -22,7 +22,7 @@ protected override void MainDbUpgrade() Execute.WithConnection(InitPriorityForBackwardCompatibility); } - private void InitPriorityForBackwardCompatibility(IDbConnection conn, IDbTransaction tran) + private static void InitPriorityForBackwardCompatibility(IDbConnection conn, IDbTransaction tran) { var downloadClients = conn.Query($"SELECT \"Id\", \"Implementation\" FROM \"DownloadClients\" WHERE \"Enable\""); diff --git a/src/NzbDrone.Core/Datastore/Migration/159_add_webrip_qualities.cs b/src/NzbDrone.Core/Datastore/Migration/159_add_webrip_qualities.cs index 277fd99f37..bc5270f649 100644 --- a/src/NzbDrone.Core/Datastore/Migration/159_add_webrip_qualities.cs +++ b/src/NzbDrone.Core/Datastore/Migration/159_add_webrip_qualities.cs @@ -16,7 +16,7 @@ protected override void MainDbUpgrade() Execute.WithConnection(ConvertProfile); } - private void ConvertProfile(IDbConnection conn, IDbTransaction tran) + private static void ConvertProfile(IDbConnection conn, IDbTransaction tran) { var updater = new ProfileUpdater159(conn, tran); diff --git a/src/NzbDrone.Core/Datastore/Migration/165_remove_custom_formats_from_quality_model.cs b/src/NzbDrone.Core/Datastore/Migration/165_remove_custom_formats_from_quality_model.cs index 4dc4a2a133..dd672fc0c6 100644 --- a/src/NzbDrone.Core/Datastore/Migration/165_remove_custom_formats_from_quality_model.cs +++ b/src/NzbDrone.Core/Datastore/Migration/165_remove_custom_formats_from_quality_model.cs @@ -80,7 +80,7 @@ private void FixPendingReleases(IDbConnection conn, IDbTransaction tran) conn.Execute(sql, newRows, transaction: tran); } - private void RemoveCustomFormatFromQuality(IDbConnection conn, IDbTransaction tran, string table) + private static void RemoveCustomFormatFromQuality(IDbConnection conn, IDbTransaction tran, string table) { var rows = conn.Query($"SELECT \"Id\", \"Quality\" from \"{table}\""); diff --git a/src/NzbDrone.Core/Datastore/Migration/168_custom_format_rework.cs b/src/NzbDrone.Core/Datastore/Migration/168_custom_format_rework.cs index 89e11b49ac..7ce3658b49 100644 --- a/src/NzbDrone.Core/Datastore/Migration/168_custom_format_rework.cs +++ b/src/NzbDrone.Core/Datastore/Migration/168_custom_format_rework.cs @@ -114,7 +114,7 @@ private ICustomFormatSpecification InitializeSpecification(Match match) } } - private Resolution ParseResolution(string value) + private static Resolution ParseResolution(string value) { switch (value) { @@ -133,7 +133,7 @@ private Resolution ParseResolution(string value) } } - private QualitySource ParseSource(string value) + private static QualitySource ParseSource(string value) { switch (value) { @@ -158,7 +158,7 @@ private QualitySource ParseSource(string value) } } - private Modifier ParseModifier(string value) + private static Modifier ParseModifier(string value) { switch (value) { @@ -177,7 +177,7 @@ private Modifier ParseModifier(string value) } } - private IndexerFlags ParseIndexerFlag(string value) + private static IndexerFlags ParseIndexerFlag(string value) { var flagValues = Enum.GetValues(typeof(IndexerFlags)); @@ -203,7 +203,7 @@ private IndexerFlags ParseIndexerFlag(string value) return (min, max); } - private string ParseString(string value, bool isRegex) + private static string ParseString(string value, bool isRegex) { return isRegex ? value : Regex.Escape(value); } diff --git a/src/NzbDrone.Core/Datastore/Migration/172_add_download_history.cs b/src/NzbDrone.Core/Datastore/Migration/172_add_download_history.cs index c1c21240ec..6deb52ebe1 100644 --- a/src/NzbDrone.Core/Datastore/Migration/172_add_download_history.cs +++ b/src/NzbDrone.Core/Datastore/Migration/172_add_download_history.cs @@ -39,7 +39,7 @@ protected override void MainDbUpgrade() { 9, 4 } // MovieHistoryType.DownloadIgnored -> DownloadHistoryType.DownloadIgnored }; - private void InitialImportedDownloadHistory(IDbConnection conn, IDbTransaction tran) + private static void InitialImportedDownloadHistory(IDbConnection conn, IDbTransaction tran) { using (var cmd = conn.CreateCommand()) { diff --git a/src/NzbDrone.Core/Datastore/Migration/180_fix_invalid_profile_references.cs b/src/NzbDrone.Core/Datastore/Migration/180_fix_invalid_profile_references.cs index 113d45324f..fca0970fa9 100644 --- a/src/NzbDrone.Core/Datastore/Migration/180_fix_invalid_profile_references.cs +++ b/src/NzbDrone.Core/Datastore/Migration/180_fix_invalid_profile_references.cs @@ -63,7 +63,7 @@ private void FixMovies(IDbConnection conn, IDbTransaction tran) } } - private List GetProfileIds(IDbConnection conn) + private static List GetProfileIds(IDbConnection conn) { return conn.Query("SELECT \"Id\" From \"Profiles\"").Select(p => p.Id).ToList(); } diff --git a/src/NzbDrone.Core/Datastore/Migration/183_download_propers_config.cs b/src/NzbDrone.Core/Datastore/Migration/183_download_propers_config.cs index 7ce2bc1061..46d86ecfbe 100644 --- a/src/NzbDrone.Core/Datastore/Migration/183_download_propers_config.cs +++ b/src/NzbDrone.Core/Datastore/Migration/183_download_propers_config.cs @@ -14,7 +14,7 @@ protected override void MainDbUpgrade() Delete.Column("PreferredTags").FromTable("Profiles"); } - private void SetMetadataFileExtension(IDbConnection conn, IDbTransaction tran) + private static void SetMetadataFileExtension(IDbConnection conn, IDbTransaction tran) { using (var cmd = conn.CreateCommand()) { diff --git a/src/NzbDrone.Core/Datastore/Migration/186_fix_tmdb_duplicates.cs b/src/NzbDrone.Core/Datastore/Migration/186_fix_tmdb_duplicates.cs index 44761539f4..fb292b5275 100644 --- a/src/NzbDrone.Core/Datastore/Migration/186_fix_tmdb_duplicates.cs +++ b/src/NzbDrone.Core/Datastore/Migration/186_fix_tmdb_duplicates.cs @@ -18,7 +18,7 @@ protected override void MainDbUpgrade() Alter.Table("Movies").AlterColumn("TmdbId").AsInt32().Unique(); } - private void FixMovies(IDbConnection conn, IDbTransaction tran) + private static void FixMovies(IDbConnection conn, IDbTransaction tran) { var movieRows = conn.Query($"SELECT \"Id\", \"TmdbId\", \"Added\", \"LastInfoSync\", \"MovieFileId\" FROM \"Movies\""); diff --git a/src/NzbDrone.Core/Datastore/Migration/187_swap_filechmod_for_folderchmod.cs b/src/NzbDrone.Core/Datastore/Migration/187_swap_filechmod_for_folderchmod.cs index 96b50380ff..6bb896c12f 100644 --- a/src/NzbDrone.Core/Datastore/Migration/187_swap_filechmod_for_folderchmod.cs +++ b/src/NzbDrone.Core/Datastore/Migration/187_swap_filechmod_for_folderchmod.cs @@ -15,7 +15,7 @@ protected override void MainDbUpgrade() Execute.WithConnection(ConvertFileChmodToFolderChmod); } - private void ConvertFileChmodToFolderChmod(IDbConnection conn, IDbTransaction tran) + private static void ConvertFileChmodToFolderChmod(IDbConnection conn, IDbTransaction tran) { using (var getFileChmodCmd = conn.CreateCommand()) { diff --git a/src/NzbDrone.Core/Datastore/Migration/199_mediainfo_to_ffmpeg.cs b/src/NzbDrone.Core/Datastore/Migration/199_mediainfo_to_ffmpeg.cs index df69accb17..ee37582350 100644 --- a/src/NzbDrone.Core/Datastore/Migration/199_mediainfo_to_ffmpeg.cs +++ b/src/NzbDrone.Core/Datastore/Migration/199_mediainfo_to_ffmpeg.cs @@ -276,7 +276,7 @@ private void MigrateVideoCodec(MediaInfo198 mediaInfo, MediaInfo199 m, string sc } } - private void MigrateVideoCodecLegacy(MediaInfo198 mediaInfo, MediaInfo199 m, string sceneName) + private static void MigrateVideoCodecLegacy(MediaInfo198 mediaInfo, MediaInfo199 m, string sceneName) { var videoCodec = mediaInfo.VideoCodec; @@ -335,7 +335,7 @@ private void MigrateVideoCodecLegacy(MediaInfo198 mediaInfo, MediaInfo199 m, str } } - private HdrFormat MigrateHdrFormat(MediaInfo198 mediaInfo) + private static HdrFormat MigrateHdrFormat(MediaInfo198 mediaInfo) { if (mediaInfo.VideoHdrFormatCompatibility.IsNotNullOrWhiteSpace()) { @@ -531,7 +531,7 @@ private void MigrateAudioCodec(MediaInfo198 mediaInfo, MediaInfo199 m) } } - private void MigrateAudioCodecLegacy(MediaInfo198 mediaInfo, MediaInfo199 m) + private static void MigrateAudioCodecLegacy(MediaInfo198 mediaInfo, MediaInfo199 m) { var audioFormat = mediaInfo.AudioFormat; @@ -617,7 +617,7 @@ private void MigrateAudioChannelPositions(MediaInfo198 mediaInfo, MediaInfo199 m m.AudioChannelPositions = audioChannels.ToString(); } - private decimal? FormatAudioChannelsFromAudioChannelPositions(MediaInfo198 mediaInfo) + private static decimal? FormatAudioChannelsFromAudioChannelPositions(MediaInfo198 mediaInfo) { var audioChannelPositions = mediaInfo.AudioChannelPositions; @@ -676,7 +676,7 @@ private void MigrateAudioChannelPositions(MediaInfo198 mediaInfo, MediaInfo199 m return null; } - private decimal? FormatAudioChannelsFromAudioChannelPositionsText(MediaInfo198 mediaInfo) + private static decimal? FormatAudioChannelsFromAudioChannelPositionsText(MediaInfo198 mediaInfo) { var audioChannelPositionsTextContainer = mediaInfo.AudioChannelPositionsTextContainer; var audioChannelPositionsTextStream = mediaInfo.AudioChannelPositionsTextStream; @@ -706,7 +706,7 @@ private void MigrateAudioChannelPositions(MediaInfo198 mediaInfo, MediaInfo199 m return null; } - private decimal? FormatAudioChannelsFromAudioChannels(MediaInfo198 mediaInfo) + private static decimal? FormatAudioChannelsFromAudioChannels(MediaInfo198 mediaInfo) { var audioChannelsContainer = mediaInfo.AudioChannelsContainer; var audioChannelsStream = mediaInfo.AudioChannelsStream; @@ -742,7 +742,7 @@ private void MigrateAudioChannelPositions(MediaInfo198 mediaInfo, MediaInfo199 m return null; } - private List MigrateLanguages(string mediaInfoLanguages) + private static List MigrateLanguages(string mediaInfoLanguages) { var languages = new List(); @@ -788,12 +788,12 @@ private List MigrateLanguages(string mediaInfoLanguages) return languages; } - private string MigratePrimaries(string primary) + private static string MigratePrimaries(string primary) { return primary.IsNotNullOrWhiteSpace() ? primary.Replace("BT.", "bt") : primary; } - private string MigrateTransferCharacteristics(string transferCharacteristics) + private static string MigrateTransferCharacteristics(string transferCharacteristics) { if (transferCharacteristics == "PQ") { diff --git a/src/NzbDrone.Core/Datastore/Migration/200_cdh_per_downloadclient.cs b/src/NzbDrone.Core/Datastore/Migration/200_cdh_per_downloadclient.cs index cf80cc465b..e98e9cfe00 100644 --- a/src/NzbDrone.Core/Datastore/Migration/200_cdh_per_downloadclient.cs +++ b/src/NzbDrone.Core/Datastore/Migration/200_cdh_per_downloadclient.cs @@ -16,7 +16,7 @@ protected override void MainDbUpgrade() Execute.WithConnection(MoveRemoveSettings); } - private void MoveRemoveSettings(IDbConnection conn, IDbTransaction tran) + private static void MoveRemoveSettings(IDbConnection conn, IDbTransaction tran) { var removeCompletedDownloads = false; var removeFailedDownloads = true; diff --git a/src/NzbDrone.Core/Datastore/WhereBuilderPostgres.cs b/src/NzbDrone.Core/Datastore/WhereBuilderPostgres.cs index 91f910c9e3..7f1c2c5d1d 100644 --- a/src/NzbDrone.Core/Datastore/WhereBuilderPostgres.cs +++ b/src/NzbDrone.Core/Datastore/WhereBuilderPostgres.cs @@ -134,7 +134,7 @@ protected override Expression VisitConstant(ConstantExpression expression) return expression; } - private bool TryGetConstantValue(Expression expression, out object result) + private static bool TryGetConstantValue(Expression expression, out object result) { result = null; @@ -207,7 +207,7 @@ private bool TryGetRightValue(Expression expression, out object value) return false; } - private object GetFieldValue(object entity, MemberInfo member) + private static object GetFieldValue(object entity, MemberInfo member) { if (member.MemberType == MemberTypes.Field) { diff --git a/src/NzbDrone.Core/Datastore/WhereBuilderSqlite.cs b/src/NzbDrone.Core/Datastore/WhereBuilderSqlite.cs index 8725361e98..5e906c2a80 100644 --- a/src/NzbDrone.Core/Datastore/WhereBuilderSqlite.cs +++ b/src/NzbDrone.Core/Datastore/WhereBuilderSqlite.cs @@ -134,7 +134,7 @@ protected override Expression VisitConstant(ConstantExpression expression) return expression; } - private bool TryGetConstantValue(Expression expression, out object result) + private static bool TryGetConstantValue(Expression expression, out object result) { result = null; @@ -207,7 +207,7 @@ private bool TryGetRightValue(Expression expression, out object value) return false; } - private object GetFieldValue(object entity, MemberInfo member) + private static object GetFieldValue(object entity, MemberInfo member) { if (member.MemberType == MemberTypes.Field) { diff --git a/src/NzbDrone.Core/DecisionEngine/DownloadDecisionComparer.cs b/src/NzbDrone.Core/DecisionEngine/DownloadDecisionComparer.cs index 712696eb15..6d525f21b0 100644 --- a/src/NzbDrone.Core/DecisionEngine/DownloadDecisionComparer.cs +++ b/src/NzbDrone.Core/DecisionEngine/DownloadDecisionComparer.cs @@ -43,7 +43,7 @@ public int Compare(DownloadDecision x, DownloadDecision y) return comparers.Select(comparer => comparer(x, y)).FirstOrDefault(result => result != 0); } - private int CompareBy(TSubject left, TSubject right, Func funcValue) + private static int CompareBy(TSubject left, TSubject right, Func funcValue) where TValue : IComparable { var leftValue = funcValue(left); @@ -58,7 +58,7 @@ private int CompareByReverse(TSubject left, TSubject right, Fu return CompareBy(left, right, funcValue) * -1; } - private int CompareAll(params int[] comparers) + private static int CompareAll(params int[] comparers) { return comparers.Select(comparer => comparer).FirstOrDefault(result => result != 0); } @@ -186,7 +186,7 @@ private int CompareSize(DownloadDecision x, DownloadDecision y) return sizeCompare; } - private int ScoreFlags(IndexerFlags flags) + private static int ScoreFlags(IndexerFlags flags) { var flagValues = Enum.GetValues(typeof(IndexerFlags)); diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/UpgradableSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/UpgradableSpecification.cs index 5fc5152f15..c10dc3948c 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/UpgradableSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/UpgradableSpecification.cs @@ -139,7 +139,7 @@ public bool QualityCutoffNotMet(QualityProfile profile, QualityModel currentQual return false; } - private bool CustomFormatCutoffNotMet(QualityProfile profile, List currentFormats) + private static bool CustomFormatCutoffNotMet(QualityProfile profile, List currentFormats) { var score = profile.CalculateCustomFormatScore(currentFormats); var cutoff = profile.UpgradeAllowed ? profile.CutoffFormatScore : profile.MinFormatScore; diff --git a/src/NzbDrone.Core/Download/Clients/Aria2/Aria2.cs b/src/NzbDrone.Core/Download/Clients/Aria2/Aria2.cs index a7e11041d4..ed9ae214c4 100644 --- a/src/NzbDrone.Core/Download/Clients/Aria2/Aria2.cs +++ b/src/NzbDrone.Core/Download/Clients/Aria2/Aria2.cs @@ -261,7 +261,7 @@ private ValidationFailure TestConnection() return null; } - private string GetOutputPath(Aria2Status torrent) + private static string GetOutputPath(Aria2Status torrent) { if (torrent.Files.Length == 1) { diff --git a/src/NzbDrone.Core/Download/Clients/Aria2/Aria2Proxy.cs b/src/NzbDrone.Core/Download/Clients/Aria2/Aria2Proxy.cs index 52f5a1bdea..0141d496f0 100644 --- a/src/NzbDrone.Core/Download/Clients/Aria2/Aria2Proxy.cs +++ b/src/NzbDrone.Core/Download/Clients/Aria2/Aria2Proxy.cs @@ -146,7 +146,7 @@ public bool RemoveCompletedTorrent(Aria2Settings settings, string gid) return result == "OK"; } - private string GetToken(Aria2Settings settings) + private static string GetToken(Aria2Settings settings) { return $"token:{settings?.SecretToken}"; } diff --git a/src/NzbDrone.Core/Download/Clients/Deluge/DelugeProxy.cs b/src/NzbDrone.Core/Download/Clients/Deluge/DelugeProxy.cs index 98f35d3fc3..36ec5dbd04 100644 --- a/src/NzbDrone.Core/Download/Clients/Deluge/DelugeProxy.cs +++ b/src/NzbDrone.Core/Download/Clients/Deluge/DelugeProxy.cs @@ -294,7 +294,7 @@ private JsonRpcResponse ExecuteRequest(JsonRpcRequestBuilder r } } - private void VerifyResponse(JsonRpcResponse response) + private static void VerifyResponse(JsonRpcResponse response) { if (response.Error != null) { @@ -368,7 +368,7 @@ private void ConnectDaemon(JsonRpcRequestBuilder requestBuilder) throw new DownloadClientException("Failed to connect to Deluge daemon."); } - private DelugeTorrent[] GetTorrents(DelugeUpdateUIResult result) + private static DelugeTorrent[] GetTorrents(DelugeUpdateUIResult result) { if (result.Torrents == null) { diff --git a/src/NzbDrone.Core/Download/Clients/DownloadStation/Proxies/DiskStationProxyBase.cs b/src/NzbDrone.Core/Download/Clients/DownloadStation/Proxies/DiskStationProxyBase.cs index c1507aa2e9..7fe65d5415 100644 --- a/src/NzbDrone.Core/Download/Clients/DownloadStation/Proxies/DiskStationProxyBase.cs +++ b/src/NzbDrone.Core/Download/Clients/DownloadStation/Proxies/DiskStationProxyBase.cs @@ -54,7 +54,7 @@ public DiskStationProxyBase(DiskStationApi apiType, _apiName = apiName; } - private string GenerateSessionCacheKey(DownloadStationSettings settings) + private static string GenerateSessionCacheKey(DownloadStationSettings settings) { return $"{settings.Username}@{settings.Host}:{settings.Port}"; } @@ -201,7 +201,7 @@ private HttpRequestBuilder BuildRequest(DownloadStationSettings settings, DiskSt return requestBuilder; } - private string GenerateInfoCacheKey(DownloadStationSettings settings, DiskStationApi api) + private static string GenerateInfoCacheKey(DownloadStationSettings settings, DiskStationApi api) { return $"{settings.Host}:{settings.Port}->{api}"; } diff --git a/src/NzbDrone.Core/Download/Clients/DownloadStation/TorrentDownloadStation.cs b/src/NzbDrone.Core/Download/Clients/DownloadStation/TorrentDownloadStation.cs index 3f89d3e31d..b43453790f 100644 --- a/src/NzbDrone.Core/Download/Clients/DownloadStation/TorrentDownloadStation.cs +++ b/src/NzbDrone.Core/Download/Clients/DownloadStation/TorrentDownloadStation.cs @@ -215,7 +215,7 @@ protected override void Test(List failures) failures.AddIfNotNull(TestGetTorrents()); } - protected bool IsFinished(DownloadStationTask torrent) + protected static bool IsFinished(DownloadStationTask torrent) { return torrent.Status == DownloadStationTaskStatus.Finished; } @@ -293,7 +293,7 @@ protected long GetRemainingSize(DownloadStationTask torrent) return TimeSpan.FromSeconds(remainingSize / downloadSpeed); } - protected double? GetSeedRatio(DownloadStationTask torrent) + protected static double? GetSeedRatio(DownloadStationTask torrent) { var downloaded = torrent.Additional.Transfer["size_downloaded"].ParseInt64(); var uploaded = torrent.Additional.Transfer["size_uploaded"].ParseInt64(); @@ -427,12 +427,12 @@ protected ValidationFailure TestGetTorrents() } } - protected string ParseDownloadId(string id) + protected static string ParseDownloadId(string id) { return id.Split(':')[1]; } - protected string CreateDownloadId(string id, string hashedSerialNumber) + protected static string CreateDownloadId(string id, string hashedSerialNumber) { return $"{hashedSerialNumber}:{id}"; } diff --git a/src/NzbDrone.Core/Download/Clients/DownloadStation/UsenetDownloadStation.cs b/src/NzbDrone.Core/Download/Clients/DownloadStation/UsenetDownloadStation.cs index 0ac81700de..63220c3309 100644 --- a/src/NzbDrone.Core/Download/Clients/DownloadStation/UsenetDownloadStation.cs +++ b/src/NzbDrone.Core/Download/Clients/DownloadStation/UsenetDownloadStation.cs @@ -382,7 +382,7 @@ protected long GetDownloadSpeed(DownloadStationTask task) return Math.Max(downloadSpeed, 0); } - protected TimeSpan? GetRemainingTime(long remainingSize, long downloadSpeed) + protected static TimeSpan? GetRemainingTime(long remainingSize, long downloadSpeed) { if (downloadSpeed > 0) { @@ -407,12 +407,12 @@ protected ValidationFailure TestGetNZB() } } - protected string ParseDownloadId(string id) + protected static string ParseDownloadId(string id) { return id.Split(':')[1]; } - protected string CreateDownloadId(string id, string hashedSerialNumber) + protected static string CreateDownloadId(string id, string hashedSerialNumber) { return $"{hashedSerialNumber}:{id}"; } diff --git a/src/NzbDrone.Core/Download/Clients/Flood/FloodProxy.cs b/src/NzbDrone.Core/Download/Clients/Flood/FloodProxy.cs index 20a53da788..78e5869b8b 100644 --- a/src/NzbDrone.Core/Download/Clients/Flood/FloodProxy.cs +++ b/src/NzbDrone.Core/Download/Clients/Flood/FloodProxy.cs @@ -35,7 +35,7 @@ public FloodProxy(IHttpClient httpClient, ICacheManager cacheManager, Logger log _authCookieCache = cacheManager.GetCache>(GetType(), "authCookies"); } - private string BuildUrl(FloodSettings settings) + private static string BuildUrl(FloodSettings settings) { return $"{(settings.UseSsl ? "https://" : "http://")}{settings.Host}:{settings.Port}/{settings.UrlBase}"; } diff --git a/src/NzbDrone.Core/Download/Clients/FreeboxDownload/TorrentFreeboxDownload.cs b/src/NzbDrone.Core/Download/Clients/FreeboxDownload/TorrentFreeboxDownload.cs index 6a0df2dab2..a7aa14d3a5 100644 --- a/src/NzbDrone.Core/Download/Clients/FreeboxDownload/TorrentFreeboxDownload.cs +++ b/src/NzbDrone.Core/Download/Clients/FreeboxDownload/TorrentFreeboxDownload.cs @@ -221,7 +221,7 @@ private bool ToBeQueuedFirst(RemoteMovie remoteMovie) return false; } - private double? GetSeedRatio(RemoteMovie remoteMovie) + private static double? GetSeedRatio(RemoteMovie remoteMovie) { if (remoteMovie.SeedConfiguration == null || remoteMovie.SeedConfiguration.Ratio == null) { diff --git a/src/NzbDrone.Core/Download/Clients/Hadouken/HadoukenProxy.cs b/src/NzbDrone.Core/Download/Clients/Hadouken/HadoukenProxy.cs index 607e936bfb..1df95603c5 100644 --- a/src/NzbDrone.Core/Download/Clients/Hadouken/HadoukenProxy.cs +++ b/src/NzbDrone.Core/Download/Clients/Hadouken/HadoukenProxy.cs @@ -158,7 +158,7 @@ private HadoukenTorrent MapTorrent(object[] item) return torrent; } - private HadoukenTorrentState ParseState(int state) + private static HadoukenTorrentState ParseState(int state) { if ((state & 1) == 1) { diff --git a/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortexProxy.cs b/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortexProxy.cs index cec43775ab..4d9b1e2580 100644 --- a/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortexProxy.cs +++ b/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortexProxy.cs @@ -113,7 +113,7 @@ public List GetFiles(int id, NzbVortexSettings settings) return response.Files; } - private HttpRequestBuilder BuildRequest(NzbVortexSettings settings) + private static HttpRequestBuilder BuildRequest(NzbVortexSettings settings) { var baseUrl = HttpRequestBuilder.BuildBaseUrl(true, settings.Host, settings.Port, settings.UrlBase); baseUrl = HttpUri.CombinePath(baseUrl, "api"); diff --git a/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs b/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs index fc4cd2ac38..49ce267f2d 100644 --- a/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs +++ b/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs @@ -347,7 +347,7 @@ private ValidationFailure TestSettings() // Javascript doesn't support 64 bit integers natively so json officially doesn't either. // NzbGet api thus sends it in two 32 bit chunks. Here we join the two chunks back together. // Simplified decimal example: "42" splits into "4" and "2". To join them I shift (<<) the "4" 1 digit to the left = "40". combine it with "2". which becomes "42" again. - private long MakeInt64(uint high, uint low) + private static long MakeInt64(uint high, uint low) { long result = high; diff --git a/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs b/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs index f5c9fe450d..01c5b39fa6 100644 --- a/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs +++ b/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs @@ -409,7 +409,7 @@ public override DownloadClientInfo GetStatus() }; } - private bool RemovesCompletedDownloads(QBittorrentPreferences config) + private static bool RemovesCompletedDownloads(QBittorrentPreferences config) { var minimumRetention = 60 * 24 * 14; // 14 days in minutes return (config.MaxRatioEnabled || (config.MaxSeedingTimeEnabled && config.MaxSeedingTime < minimumRetention)) && (config.MaxRatioAction == QBittorrentMaxRatioAction.Remove || config.MaxRatioAction == QBittorrentMaxRatioAction.DeleteFiles); @@ -610,7 +610,7 @@ private ValidationFailure TestGetTorrents() return null; } - protected TimeSpan? GetRemainingTime(QBittorrentTorrent torrent) + protected static TimeSpan? GetRemainingTime(QBittorrentTorrent torrent) { if (torrent.Eta < 0 || torrent.Eta > 365 * 24 * 3600) { @@ -715,7 +715,7 @@ protected bool HasReachedSeedingTimeLimit(QBittorrentTorrent torrent, QBittorren return false; } - protected bool HasReachedInactiveSeedingTimeLimit(QBittorrentTorrent torrent, QBittorrentPreferences config) + protected static bool HasReachedInactiveSeedingTimeLimit(QBittorrentTorrent torrent, QBittorrentPreferences config) { long inactiveSeedingTimeLimit; diff --git a/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrentProxyV2.cs b/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrentProxyV2.cs index 369819d676..99ee21347b 100644 --- a/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrentProxyV2.cs +++ b/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrentProxyV2.cs @@ -223,7 +223,7 @@ public Dictionary GetLabels(QBittorrentSettings settin return Json.Deserialize>(ProcessRequest(request, settings)); } - private void AddTorrentSeedingFormParameters(HttpRequestBuilder request, TorrentSeedConfiguration seedConfiguration, bool always = false) + private static void AddTorrentSeedingFormParameters(HttpRequestBuilder request, TorrentSeedConfiguration seedConfiguration, bool always = false) { var ratioLimit = seedConfiguration.Ratio.HasValue ? seedConfiguration.Ratio : -2; var seedingTimeLimit = seedConfiguration.SeedTime.HasValue ? (long)seedConfiguration.SeedTime.Value.TotalMinutes : -2; diff --git a/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs b/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs index 02e8a17ef1..c85d1cf68d 100644 --- a/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs +++ b/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs @@ -331,7 +331,7 @@ private bool HasVersion(int major, int minor, int patch = 0) return true; } - private Version ParseVersion(string version) + private static Version ParseVersion(string version) { if (version.IsNullOrWhiteSpace()) { @@ -520,7 +520,7 @@ private ValidationFailure TestCategory() return null; } - private bool ContainsCategory(IEnumerable categories, string category) + private static bool ContainsCategory(IEnumerable categories, string category) { if (categories == null || categories.Empty()) { @@ -535,7 +535,7 @@ private bool ContainsCategory(IEnumerable categories, string category) return categories.Contains(category); } - private bool RemovesCompletedDownloads(SabnzbdConfig config) + private static bool RemovesCompletedDownloads(SabnzbdConfig config) { var retention = config.Misc.history_retention; var option = config.Misc.history_retention_option; @@ -573,7 +573,7 @@ private bool RemovesCompletedDownloads(SabnzbdConfig config) return retention != "0"; } - private bool ValidatePath(DownloadClientItem downloadClientItem) + private static bool ValidatePath(DownloadClientItem downloadClientItem) { var downloadItemOutputPath = downloadClientItem.OutputPath; diff --git a/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdProxy.cs b/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdProxy.cs index b5edd8bec1..ba062a5765 100644 --- a/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdProxy.cs +++ b/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdProxy.cs @@ -219,7 +219,7 @@ private string ProcessRequest(HttpRequestBuilder requestBuilder, SabnzbdSettings return response.Content; } - private void CheckForError(HttpResponse response) + private static void CheckForError(HttpResponse response) { if (!Json.TryDeserialize(response.Content, out var result)) { diff --git a/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionBase.cs b/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionBase.cs index 96e1c94ca4..c10de62e29 100644 --- a/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionBase.cs +++ b/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionBase.cs @@ -142,7 +142,7 @@ public override IEnumerable GetItems() return items; } - protected bool HasReachedSeedLimit(TransmissionTorrent torrent, double? ratio, Lazy config) + protected static bool HasReachedSeedLimit(TransmissionTorrent torrent, double? ratio, Lazy config) { var isStopped = torrent.Status == TransmissionTorrentStatus.Stopped; var isSeeding = torrent.Status == TransmissionTorrentStatus.Seeding; diff --git a/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionProxy.cs b/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionProxy.cs index ce5f720249..b79efa9624 100644 --- a/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionProxy.cs +++ b/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionProxy.cs @@ -242,7 +242,7 @@ private TransmissionResponse GetTorrentStatus(IEnumerable hashStrings, T return result; } - private string GetBaseUrl(TransmissionSettings settings) + private static string GetBaseUrl(TransmissionSettings settings) { return HttpRequestBuilder.BuildBaseUrl(settings.UseSsl, settings.Host, settings.Port, settings.UrlBase); } diff --git a/src/NzbDrone.Core/Download/Clients/rTorrent/RTorrentProxy.cs b/src/NzbDrone.Core/Download/Clients/rTorrent/RTorrentProxy.cs index 00f0ede064..4193479cbc 100644 --- a/src/NzbDrone.Core/Download/Clients/rTorrent/RTorrentProxy.cs +++ b/src/NzbDrone.Core/Download/Clients/rTorrent/RTorrentProxy.cs @@ -163,7 +163,7 @@ public bool HasHashTorrent(string hash, RTorrentSettings settings) } } - private string[] GetCommands(string label, RTorrentPriority priority, string directory) + private static string[] GetCommands(string label, RTorrentPriority priority, string directory) { var result = new List(); diff --git a/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrentProxy.cs b/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrentProxy.cs index 36257bd991..5c2ee50a61 100644 --- a/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrentProxy.cs +++ b/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrentProxy.cs @@ -187,7 +187,7 @@ public void SetState(string hash, UTorrentState state, UTorrentSettings settings ProcessRequest(requestBuilder, settings); } - private HttpRequestBuilder BuildRequest(UTorrentSettings settings) + private static HttpRequestBuilder BuildRequest(UTorrentSettings settings) { var requestBuilder = new HttpRequestBuilder(settings.UseSsl, settings.Host, settings.Port, settings.UrlBase) .Resource("/gui/") diff --git a/src/NzbDrone.Core/Download/CompletedDownloadService.cs b/src/NzbDrone.Core/Download/CompletedDownloadService.cs index 76507ee272..4b926c77d0 100644 --- a/src/NzbDrone.Core/Download/CompletedDownloadService.cs +++ b/src/NzbDrone.Core/Download/CompletedDownloadService.cs @@ -282,7 +282,7 @@ private void SetImportItem(TrackedDownload trackedDownload) trackedDownload.ImportItem = _provideImportItemService.ProvideImportItem(trackedDownload.DownloadItem, trackedDownload.ImportItem); } - private bool ValidatePath(TrackedDownload trackedDownload) + private static bool ValidatePath(TrackedDownload trackedDownload) { var downloadItemOutputPath = trackedDownload.ImportItem.OutputPath; diff --git a/src/NzbDrone.Core/Download/DownloadExtractionService.cs b/src/NzbDrone.Core/Download/DownloadExtractionService.cs index 26b8aa09ab..1ee8a59197 100644 --- a/src/NzbDrone.Core/Download/DownloadExtractionService.cs +++ b/src/NzbDrone.Core/Download/DownloadExtractionService.cs @@ -132,7 +132,7 @@ private string ExtractArchivesInFolder(string folderPath) return folderPath; } - private bool IsPartOfMultiVolumeArchive(string path) + private static bool IsPartOfMultiVolumeArchive(string path) { var extension = Path.GetExtension(path); @@ -170,7 +170,7 @@ private void DeleteArchiveWithParts(string archivePath) _diskProvider.DeleteFile(archivePath); } - private bool IsArchivePartFile(string filePath, string baseName) + private static bool IsArchivePartFile(string filePath, string baseName) { var fileName = Path.GetFileNameWithoutExtension(filePath); var extension = Path.GetExtension(filePath); diff --git a/src/NzbDrone.Core/Download/Pending/PendingReleaseService.cs b/src/NzbDrone.Core/Download/Pending/PendingReleaseService.cs index 56f1b7a457..cdf858af7b 100644 --- a/src/NzbDrone.Core/Download/Pending/PendingReleaseService.cs +++ b/src/NzbDrone.Core/Download/Pending/PendingReleaseService.cs @@ -450,7 +450,7 @@ private PendingRelease FindPendingRelease(int queueId) return GetPendingReleases().First(p => queueId == GetQueueId(p, p.RemoteMovie.Movie)); } - private int GetQueueId(PendingRelease pendingRelease, Movie movie) + private static int GetQueueId(PendingRelease pendingRelease, Movie movie) { return HashConverter.GetHashInt31(string.Format("pending-{0}-movie{1}", pendingRelease.Id, movie?.Id ?? 0)); } diff --git a/src/NzbDrone.Core/Download/ProcessDownloadDecisions.cs b/src/NzbDrone.Core/Download/ProcessDownloadDecisions.cs index a2221824d5..578be79f15 100644 --- a/src/NzbDrone.Core/Download/ProcessDownloadDecisions.cs +++ b/src/NzbDrone.Core/Download/ProcessDownloadDecisions.cs @@ -158,13 +158,13 @@ internal List GetQualifiedReports(IEnumerable decisions, DownloadDecision report) + private static bool IsMovieProcessed(List decisions, DownloadDecision report) { var movieId = report.RemoteMovie.Movie.Id; diff --git a/src/NzbDrone.Core/Extras/ImportExistingExtraFilesBase.cs b/src/NzbDrone.Core/Extras/ImportExistingExtraFilesBase.cs index f9f2560b3c..a41fd2f83e 100644 --- a/src/NzbDrone.Core/Extras/ImportExistingExtraFilesBase.cs +++ b/src/NzbDrone.Core/Extras/ImportExistingExtraFilesBase.cs @@ -39,7 +39,7 @@ public virtual ImportExistingExtraFileFilterResult FilterAndClean(Mo return Filter(movie, filesOnDisk, importedFiles, movieFiles); } - private ImportExistingExtraFileFilterResult Filter(Movie movie, List filesOnDisk, List importedFiles, List movieFiles) + private static ImportExistingExtraFileFilterResult Filter(Movie movie, List filesOnDisk, List importedFiles, List movieFiles) { var previouslyImported = movieFiles.IntersectBy(s => Path.Combine(movie.Path, s.RelativePath), filesOnDisk, f => f, PathEqualityComparer.Instance).ToList(); var filteredFiles = filesOnDisk.Except(previouslyImported.Select(f => Path.Combine(movie.Path, f.RelativePath)).ToList(), PathEqualityComparer.Instance) diff --git a/src/NzbDrone.Core/Extras/Metadata/Consumers/MediaBrowser/MediaBrowserMetadata.cs b/src/NzbDrone.Core/Extras/Metadata/Consumers/MediaBrowser/MediaBrowserMetadata.cs index 89f950a2f9..4029bf7d0e 100644 --- a/src/NzbDrone.Core/Extras/Metadata/Consumers/MediaBrowser/MediaBrowserMetadata.cs +++ b/src/NzbDrone.Core/Extras/Metadata/Consumers/MediaBrowser/MediaBrowserMetadata.cs @@ -100,7 +100,7 @@ public override List MovieImages(Movie movie) return new List(); } - private IEnumerable ProcessMovieImages(Movie movie) + private static IEnumerable ProcessMovieImages(Movie movie) { return new List(); } diff --git a/src/NzbDrone.Core/Extras/Metadata/Consumers/Roksbox/RoksboxMetadata.cs b/src/NzbDrone.Core/Extras/Metadata/Consumers/Roksbox/RoksboxMetadata.cs index 9526da43f6..4ade57eae5 100644 --- a/src/NzbDrone.Core/Extras/Metadata/Consumers/Roksbox/RoksboxMetadata.cs +++ b/src/NzbDrone.Core/Extras/Metadata/Consumers/Roksbox/RoksboxMetadata.cs @@ -149,12 +149,12 @@ public override List MovieImages(Movie movie) return new List { new ImageFileResult(destination, source) }; } - private string GetMovieFileMetadataFilename(string movieFilePath) + private static string GetMovieFileMetadataFilename(string movieFilePath) { return Path.ChangeExtension(movieFilePath, "xml"); } - private string GetMovieFileImageFilename(string movieFilePath) + private static string GetMovieFileImageFilename(string movieFilePath) { return Path.ChangeExtension(movieFilePath, "jpg"); } diff --git a/src/NzbDrone.Core/Extras/Metadata/Consumers/Wdtv/WdtvMetadata.cs b/src/NzbDrone.Core/Extras/Metadata/Consumers/Wdtv/WdtvMetadata.cs index ed5686b0b8..3650ba556f 100644 --- a/src/NzbDrone.Core/Extras/Metadata/Consumers/Wdtv/WdtvMetadata.cs +++ b/src/NzbDrone.Core/Extras/Metadata/Consumers/Wdtv/WdtvMetadata.cs @@ -148,12 +148,12 @@ public override List MovieImages(Movie movie) }; } - private string GetMovieFileMetadataFilename(string movieFilePath) + private static string GetMovieFileMetadataFilename(string movieFilePath) { return Path.ChangeExtension(movieFilePath, "xml"); } - private string GetMovieFileImageFilename(string movieFilePath) + private static string GetMovieFileImageFilename(string movieFilePath) { return Path.ChangeExtension(movieFilePath, "metathumb"); } diff --git a/src/NzbDrone.Core/Extras/Metadata/MetadataService.cs b/src/NzbDrone.Core/Extras/Metadata/MetadataService.cs index a0bd090025..6e634bdcfb 100644 --- a/src/NzbDrone.Core/Extras/Metadata/MetadataService.cs +++ b/src/NzbDrone.Core/Extras/Metadata/MetadataService.cs @@ -202,7 +202,7 @@ public override IEnumerable ImportFiles(LocalMovie localMovie, MovieF return Enumerable.Empty(); } - private List GetMetadataFilesForConsumer(IMetadata consumer, List movieMetadata) + private static List GetMetadataFilesForConsumer(IMetadata consumer, List movieMetadata) { return movieMetadata.Where(c => c.Consumer == consumer.GetType().Name).ToList(); } diff --git a/src/NzbDrone.Core/Extras/Subtitles/SubtitleService.cs b/src/NzbDrone.Core/Extras/Subtitles/SubtitleService.cs index 00fea36aa3..de537b4d71 100644 --- a/src/NzbDrone.Core/Extras/Subtitles/SubtitleService.cs +++ b/src/NzbDrone.Core/Extras/Subtitles/SubtitleService.cs @@ -235,7 +235,7 @@ public override IEnumerable ImportFiles(LocalMovie localMovie, MovieF return importedFiles; } - private string GetSuffix(Language language, int copy, List languageTags, bool multipleCopies = false, string title = null) + private static string GetSuffix(Language language, int copy, List languageTags, bool multipleCopies = false, string title = null) { var suffixBuilder = new StringBuilder(); diff --git a/src/NzbDrone.Core/HealthCheck/Checks/ImportListRootFolderCheck.cs b/src/NzbDrone.Core/HealthCheck/Checks/ImportListRootFolderCheck.cs index 3005647084..8e2a053e45 100644 --- a/src/NzbDrone.Core/HealthCheck/Checks/ImportListRootFolderCheck.cs +++ b/src/NzbDrone.Core/HealthCheck/Checks/ImportListRootFolderCheck.cs @@ -87,7 +87,7 @@ public override HealthCheck Check() return new HealthCheck(GetType()); } - private string FormatRootFolder(string rootFolderPath, List importLists) + private static string FormatRootFolder(string rootFolderPath, List importLists) { return $"{rootFolderPath} ({string.Join(", ", importLists.Select(l => l.Name))})"; } diff --git a/src/NzbDrone.Core/HealthCheck/Checks/MovieCollectionRootFolderCheck.cs b/src/NzbDrone.Core/HealthCheck/Checks/MovieCollectionRootFolderCheck.cs index 58524c45cc..234e9767b9 100644 --- a/src/NzbDrone.Core/HealthCheck/Checks/MovieCollectionRootFolderCheck.cs +++ b/src/NzbDrone.Core/HealthCheck/Checks/MovieCollectionRootFolderCheck.cs @@ -82,7 +82,7 @@ public override HealthCheck Check() return new HealthCheck(GetType()); } - private string FormatRootFolder(string rootFolderPath, List collections) + private static string FormatRootFolder(string rootFolderPath, List collections) { return $"{rootFolderPath} ({string.Join(", ", collections.Select(c => c.Title))})"; } diff --git a/src/NzbDrone.Core/History/HistoryRepository.cs b/src/NzbDrone.Core/History/HistoryRepository.cs index 84a67f3b06..d4efbaa903 100644 --- a/src/NzbDrone.Core/History/HistoryRepository.cs +++ b/src/NzbDrone.Core/History/HistoryRepository.cs @@ -133,7 +133,7 @@ protected override IEnumerable PagedQuery(SqlBuilder builder) => return hist; }); - private string BuildLanguageWhereClause(int[] languages) + private static string BuildLanguageWhereClause(int[] languages) { var clauses = new List(); @@ -153,7 +153,7 @@ private string BuildLanguageWhereClause(int[] languages) return $"({string.Join(" OR ", clauses)})"; } - private string BuildQualityWhereClause(int[] qualities) + private static string BuildQualityWhereClause(int[] qualities) { var clauses = new List(); diff --git a/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupUnusedTags.cs b/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupUnusedTags.cs index 9bb87a771b..17b6b2750f 100644 --- a/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupUnusedTags.cs +++ b/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupUnusedTags.cs @@ -49,7 +49,7 @@ public void Clean() } } - private int[] GetUsedTags(string table, IDbConnection mapper) + private static int[] GetUsedTags(string table, IDbConnection mapper) { return mapper .Query>( diff --git a/src/NzbDrone.Core/Http/HttpProxySettingsProvider.cs b/src/NzbDrone.Core/Http/HttpProxySettingsProvider.cs index 32beb8080b..0b73343acd 100644 --- a/src/NzbDrone.Core/Http/HttpProxySettingsProvider.cs +++ b/src/NzbDrone.Core/Http/HttpProxySettingsProvider.cs @@ -49,7 +49,7 @@ public HttpProxySettings GetProxySettings() _configService.ProxyPassword); } - public bool ShouldProxyBeBypassed(HttpProxySettings proxySettings, HttpUri url) + public static bool ShouldProxyBeBypassed(HttpProxySettings proxySettings, HttpUri url) { // We are utilizing the WebProxy implementation here to save us having to re-implement it. This way we use Microsofts implementation var proxy = new WebProxy(proxySettings.Host + ":" + proxySettings.Port, proxySettings.BypassLocalAddress, proxySettings.BypassListAsArray); diff --git a/src/NzbDrone.Core/ImportLists/Plex/PlexParser.cs b/src/NzbDrone.Core/ImportLists/Plex/PlexParser.cs index 21032c5ecf..524c14aa82 100644 --- a/src/NzbDrone.Core/ImportLists/Plex/PlexParser.cs +++ b/src/NzbDrone.Core/ImportLists/Plex/PlexParser.cs @@ -66,7 +66,7 @@ protected virtual bool PreProcess(ImportListResponse importListResponse) return true; } - private string FindGuid(List guids, string prefix) + private static string FindGuid(List guids, string prefix) { var scheme = $"{prefix}://"; diff --git a/src/NzbDrone.Core/ImportLists/RSSImport/RSSImportParser.cs b/src/NzbDrone.Core/ImportLists/RSSImport/RSSImportParser.cs index 5f9b8dc7dd..c59b59e371 100644 --- a/src/NzbDrone.Core/ImportLists/RSSImport/RSSImportParser.cs +++ b/src/NzbDrone.Core/ImportLists/RSSImport/RSSImportParser.cs @@ -199,7 +199,7 @@ protected virtual string GetImdbId(XElement item) return Parser.Parser.ParseImdbId(url); } - protected IEnumerable GetItems(XDocument document) + protected static IEnumerable GetItems(XDocument document) { var root = document.Root; diff --git a/src/NzbDrone.Core/ImportLists/Radarr/RadarrV3Proxy.cs b/src/NzbDrone.Core/ImportLists/Radarr/RadarrV3Proxy.cs index 6ed288b719..da4b471969 100644 --- a/src/NzbDrone.Core/ImportLists/Radarr/RadarrV3Proxy.cs +++ b/src/NzbDrone.Core/ImportLists/Radarr/RadarrV3Proxy.cs @@ -85,7 +85,7 @@ public ValidationFailure Test(RadarrSettings settings) return null; } - private HttpRequestBuilder BuildRequest(string resource, RadarrSettings settings) + private static HttpRequestBuilder BuildRequest(string resource, RadarrSettings settings) { var baseUrl = settings.BaseUrl.TrimEnd('/'); diff --git a/src/NzbDrone.Core/ImportLists/Rss/RssImportBaseParser.cs b/src/NzbDrone.Core/ImportLists/Rss/RssImportBaseParser.cs index b2c68a518a..3dd897e887 100644 --- a/src/NzbDrone.Core/ImportLists/Rss/RssImportBaseParser.cs +++ b/src/NzbDrone.Core/ImportLists/Rss/RssImportBaseParser.cs @@ -98,7 +98,7 @@ protected virtual XDocument LoadXmlDocument(ImportListResponse importListRespons } } - protected IEnumerable GetItems(XDocument document) + protected static IEnumerable GetItems(XDocument document) { var root = document.Root; diff --git a/src/NzbDrone.Core/ImportLists/TMDb/TMDbParser.cs b/src/NzbDrone.Core/ImportLists/TMDb/TMDbParser.cs index cede5d9852..9d7c1eaf1b 100644 --- a/src/NzbDrone.Core/ImportLists/TMDb/TMDbParser.cs +++ b/src/NzbDrone.Core/ImportLists/TMDb/TMDbParser.cs @@ -47,7 +47,7 @@ protected ImportListMovie MapListMovie(MovieResultResource movieResult) return movie; } - private MediaCover.MediaCover MapPosterImage(string path) + private static MediaCover.MediaCover MapPosterImage(string path) { if (path.IsNotNullOrWhiteSpace()) { diff --git a/src/NzbDrone.Core/IndexerSearch/ReleaseSearchService.cs b/src/NzbDrone.Core/IndexerSearch/ReleaseSearchService.cs index e21b0262fe..a87cba171d 100644 --- a/src/NzbDrone.Core/IndexerSearch/ReleaseSearchService.cs +++ b/src/NzbDrone.Core/IndexerSearch/ReleaseSearchService.cs @@ -141,7 +141,7 @@ private async Task> DispatchIndexer(Func(); } - private List DeDupeDecisions(List decisions) + private static List DeDupeDecisions(List decisions) { // De-dupe reports by guid so duplicate results aren't returned. Pick the one with the least rejections and higher indexer priority. return decisions.GroupBy(d => d.RemoteMovie.Release.Guid) diff --git a/src/NzbDrone.Core/Indexers/HDBits/HDBitsRequestGenerator.cs b/src/NzbDrone.Core/Indexers/HDBits/HDBitsRequestGenerator.cs index 7d21db9f3f..5516c52aa0 100644 --- a/src/NzbDrone.Core/Indexers/HDBits/HDBitsRequestGenerator.cs +++ b/src/NzbDrone.Core/Indexers/HDBits/HDBitsRequestGenerator.cs @@ -44,7 +44,7 @@ public IndexerPageableRequestChain GetSearchRequests(AudiobookSearchCriteria sea return new IndexerPageableRequestChain(); } - private bool TryAddSearchParameters(TorrentQuery query, SearchCriteriaBase searchCriteria) + private static bool TryAddSearchParameters(TorrentQuery query, SearchCriteriaBase searchCriteria) { if (searchCriteria.Movie.MovieMetadata.Value.ImdbId.IsNullOrWhiteSpace()) { diff --git a/src/NzbDrone.Core/Indexers/MyAnonamouse/MyAnonamouseRequestGenerator.cs b/src/NzbDrone.Core/Indexers/MyAnonamouse/MyAnonamouseRequestGenerator.cs index 95e0e0c7bb..cc7eca1d8d 100644 --- a/src/NzbDrone.Core/Indexers/MyAnonamouse/MyAnonamouseRequestGenerator.cs +++ b/src/NzbDrone.Core/Indexers/MyAnonamouse/MyAnonamouseRequestGenerator.cs @@ -61,7 +61,7 @@ public IndexerPageableRequestChain GetSearchRequests(AudiobookSearchCriteria sea return pageableRequests; } - private string BuildSearchTerm(SearchCriteriaBase searchCriteria) + private static string BuildSearchTerm(SearchCriteriaBase searchCriteria) { var terms = new List(); diff --git a/src/NzbDrone.Core/Indexers/Newznab/NewznabRssParser.cs b/src/NzbDrone.Core/Indexers/Newznab/NewznabRssParser.cs index a95f9840b4..fe2447b772 100644 --- a/src/NzbDrone.Core/Indexers/Newznab/NewznabRssParser.cs +++ b/src/NzbDrone.Core/Indexers/Newznab/NewznabRssParser.cs @@ -241,7 +241,7 @@ protected IndexerFlags GetFlags(XElement item) return flags; } - protected string TryGetNewznabAttribute(XElement item, string key, string defaultValue = "") + protected static string TryGetNewznabAttribute(XElement item, string key, string defaultValue = "") { var attrElement = item.Elements(ns + "attr").FirstOrDefault(e => e.Attribute("name").Value.Equals(key, StringComparison.OrdinalIgnoreCase)); if (attrElement != null) @@ -256,7 +256,7 @@ protected string TryGetNewznabAttribute(XElement item, string key, string defaul return defaultValue; } - protected List TryGetMultipleNewznabAttributes(XElement item, string key) + protected static List TryGetMultipleNewznabAttributes(XElement item, string key) { var attrElements = item.Elements(ns + "attr").Where(e => e.Attribute("name").Value.Equals(key, StringComparison.OrdinalIgnoreCase)); var results = new List(); diff --git a/src/NzbDrone.Core/Indexers/Nyaa/NyaaRequestGenerator.cs b/src/NzbDrone.Core/Indexers/Nyaa/NyaaRequestGenerator.cs index fdf76bac7b..b8c56f4f11 100644 --- a/src/NzbDrone.Core/Indexers/Nyaa/NyaaRequestGenerator.cs +++ b/src/NzbDrone.Core/Indexers/Nyaa/NyaaRequestGenerator.cs @@ -52,7 +52,7 @@ private IEnumerable GetPagedRequests(string term) yield return new IndexerRequest(baseUrl, HttpAccept.Rss); } - private string PrepareQuery(string query) + private static string PrepareQuery(string query) { return query.Replace(' ', '+'); } diff --git a/src/NzbDrone.Core/Indexers/RssParser.cs b/src/NzbDrone.Core/Indexers/RssParser.cs index 239cebc4da..412ec472e8 100644 --- a/src/NzbDrone.Core/Indexers/RssParser.cs +++ b/src/NzbDrone.Core/Indexers/RssParser.cs @@ -323,7 +323,7 @@ protected virtual RssEnclosure GetEnclosure(RssEnclosure[] enclosures, bool enfo return enclosures.SingleOrDefault(); } - protected IEnumerable GetItems(XDocument document) + protected static IEnumerable GetItems(XDocument document) { var root = document.Root; diff --git a/src/NzbDrone.Core/Indexers/TorrentPotato/TorrentPotatoParser.cs b/src/NzbDrone.Core/Indexers/TorrentPotato/TorrentPotatoParser.cs index 069a49902b..48d118b345 100644 --- a/src/NzbDrone.Core/Indexers/TorrentPotato/TorrentPotatoParser.cs +++ b/src/NzbDrone.Core/Indexers/TorrentPotato/TorrentPotatoParser.cs @@ -50,7 +50,7 @@ public IList ParseResponse(IndexerResponse indexerResponse) public Action, DateTime?> CookiesUpdater { get; set; } - private string GetGuid(Result torrent) + private static string GetGuid(Result torrent) { var match = RegexGuid.Match(torrent.download_url); diff --git a/src/NzbDrone.Core/Indexers/TorrentRss/TorrentRssSettingsDetector.cs b/src/NzbDrone.Core/Indexers/TorrentRss/TorrentRssSettingsDetector.cs index 0e13aec355..16cc55f707 100644 --- a/src/NzbDrone.Core/Indexers/TorrentRss/TorrentRssSettingsDetector.cs +++ b/src/NzbDrone.Core/Indexers/TorrentRss/TorrentRssSettingsDetector.cs @@ -274,7 +274,7 @@ private void ValidateReleases(TorrentInfo[] releases, TorrentRssIndexerSettings } } - private void ValidateReleaseSize(TorrentInfo[] releases, TorrentRssIndexerSettings indexerSettings) + private static void ValidateReleaseSize(TorrentInfo[] releases, TorrentRssIndexerSettings indexerSettings) { if (!indexerSettings.AllowZeroSize && releases.Any(r => r.Size == 0)) { diff --git a/src/NzbDrone.Core/Indexers/Torznab/TorznabRssParser.cs b/src/NzbDrone.Core/Indexers/Torznab/TorznabRssParser.cs index 0e873447d6..674e9ec43b 100644 --- a/src/NzbDrone.Core/Indexers/Torznab/TorznabRssParser.cs +++ b/src/NzbDrone.Core/Indexers/Torznab/TorznabRssParser.cs @@ -266,7 +266,7 @@ protected IndexerFlags GetFlags(XElement item) return flags; } - protected string TryGetTorznabAttribute(XElement item, string key, string defaultValue = "") + protected static string TryGetTorznabAttribute(XElement item, string key, string defaultValue = "") { var attr = item.Elements(ns + "attr").FirstOrDefault(e => e.Attribute("name").Value.Equals(key, StringComparison.CurrentCultureIgnoreCase)); @@ -290,7 +290,7 @@ protected float TryGetFloatTorznabAttribute(XElement item, string key, float def return defaultValue; } - protected List TryGetMultipleTorznabAttributes(XElement item, string key) + protected static List TryGetMultipleTorznabAttributes(XElement item, string key) { var attrElements = item.Elements(ns + "attr").Where(e => e.Attribute("name").Value.Equals(key, StringComparison.OrdinalIgnoreCase)); var results = new List(); diff --git a/src/NzbDrone.Core/Instrumentation/ReconfigureLogging.cs b/src/NzbDrone.Core/Instrumentation/ReconfigureLogging.cs index d49bb06d76..42ea662781 100644 --- a/src/NzbDrone.Core/Instrumentation/ReconfigureLogging.cs +++ b/src/NzbDrone.Core/Instrumentation/ReconfigureLogging.cs @@ -142,7 +142,7 @@ private void SetSyslogParameters(string syslogServer, int syslogPort, LogLevel m LogManager.Configuration.LoggingRules.Add(loggingRule); } - private List GetLogLevels() + private static List GetLogLevels() { return new List { diff --git a/src/NzbDrone.Core/Instrumentation/ReconfigureSentry.cs b/src/NzbDrone.Core/Instrumentation/ReconfigureSentry.cs index 2d8f14b202..e90d4c2c66 100644 --- a/src/NzbDrone.Core/Instrumentation/ReconfigureSentry.cs +++ b/src/NzbDrone.Core/Instrumentation/ReconfigureSentry.cs @@ -30,7 +30,7 @@ public void Reconfigure() var sentryTarget = LogManager.Configuration.AllTargets.OfType().FirstOrDefault(); if (sentryTarget != null) { - sentryTarget.UpdateScope(_database.Version, _database.Migration, _configFileProvider.Branch, _platformInfo); + SentryTarget.UpdateScope(_database.Version, _database.Migration, _configFileProvider.Branch, _platformInfo); } } diff --git a/src/NzbDrone.Core/Localization/LocalizationService.cs b/src/NzbDrone.Core/Localization/LocalizationService.cs index 1a5a708032..87d0f4d757 100644 --- a/src/NzbDrone.Core/Localization/LocalizationService.cs +++ b/src/NzbDrone.Core/Localization/LocalizationService.cs @@ -97,7 +97,7 @@ public string GetLanguageIdentifier() return language; } - private string ReplaceTokens(string input, Dictionary tokens) + private static string ReplaceTokens(string input, Dictionary tokens) { tokens.TryAdd("appName", "Radarr"); diff --git a/src/NzbDrone.Core/MediaCover/MediaCoverService.cs b/src/NzbDrone.Core/MediaCover/MediaCoverService.cs index 8a2a32a39c..223dd0d939 100644 --- a/src/NzbDrone.Core/MediaCover/MediaCoverService.cs +++ b/src/NzbDrone.Core/MediaCover/MediaCoverService.cs @@ -252,7 +252,7 @@ private void EnsureResizedCovers(Movie movie, MediaCover cover, bool forceResize } } - private string GetExtension(MediaCoverTypes coverType) + private static string GetExtension(MediaCoverTypes coverType) { return coverType switch { diff --git a/src/NzbDrone.Core/MediaFiles/DownloadedMovieImportService.cs b/src/NzbDrone.Core/MediaFiles/DownloadedMovieImportService.cs index dc50cac168..720623fb6c 100644 --- a/src/NzbDrone.Core/MediaFiles/DownloadedMovieImportService.cs +++ b/src/NzbDrone.Core/MediaFiles/DownloadedMovieImportService.cs @@ -325,7 +325,7 @@ private List ProcessFile(FileInfo fileInfo, ImportMode importMode, return _importApprovedMovie.Import(decisions, true, downloadClientItem, importMode); } - private string GetCleanedUpFolderName(string folder) + private static string GetCleanedUpFolderName(string folder) { folder = folder.Replace("_UNPACK_", "") .Replace("_FAILED_", ""); @@ -346,7 +346,7 @@ private ImportResult UnknownMovieResult(string message, string videoFile = null) return new ImportResult(new ImportDecision(localMovie, new ImportRejection(ImportRejectionReason.UnknownMovie, "Unknown Movie")), message); } - private ImportResult RejectionResult(ImportRejectionReason reason, string message) + private static ImportResult RejectionResult(ImportRejectionReason reason, string message) { return new ImportResult(new ImportDecision(null, new ImportRejection(reason, message)), message); } diff --git a/src/NzbDrone.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs b/src/NzbDrone.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs index cbfb17e888..cc8f636ede 100644 --- a/src/NzbDrone.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs +++ b/src/NzbDrone.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs @@ -176,7 +176,7 @@ private static long GetBitrate(MediaStream mediaStream) return 0; } - private VideoStream GetPrimaryVideoStream(IMediaAnalysis mediaAnalysis) + private static VideoStream GetPrimaryVideoStream(IMediaAnalysis mediaAnalysis) { if (mediaAnalysis.VideoStreams.Count <= 1) { diff --git a/src/NzbDrone.Core/MediaFiles/MovieImport/DetectSample.cs b/src/NzbDrone.Core/MediaFiles/MovieImport/DetectSample.cs index 4036547114..cb7bf118f9 100644 --- a/src/NzbDrone.Core/MediaFiles/MovieImport/DetectSample.cs +++ b/src/NzbDrone.Core/MediaFiles/MovieImport/DetectSample.cs @@ -75,7 +75,7 @@ public DetectSampleResult IsSample(MovieMetadata movie, string path) return DetectSampleResult.NotSample; } - private int GetMinimumAllowedRuntime(MovieMetadata movie) + private static int GetMinimumAllowedRuntime(MovieMetadata movie) { // Anime short - 15 seconds if (movie.Runtime <= 3) diff --git a/src/NzbDrone.Core/MediaFiles/MovieImport/ImportApprovedMovie.cs b/src/NzbDrone.Core/MediaFiles/MovieImport/ImportApprovedMovie.cs index 5bf3cad387..12a1f10be3 100644 --- a/src/NzbDrone.Core/MediaFiles/MovieImport/ImportApprovedMovie.cs +++ b/src/NzbDrone.Core/MediaFiles/MovieImport/ImportApprovedMovie.cs @@ -208,7 +208,7 @@ public List Import(List decisions, bool newDownloa return importResults; } - private string GetOriginalFilePath(DownloadClientItem downloadClientItem, LocalMovie localMovie) + private static string GetOriginalFilePath(DownloadClientItem downloadClientItem, LocalMovie localMovie) { var path = localMovie.Path; diff --git a/src/NzbDrone.Core/MediaFiles/MovieImport/Manual/ManualImportService.cs b/src/NzbDrone.Core/MediaFiles/MovieImport/Manual/ManualImportService.cs index 3c70885b10..041a98fcbb 100644 --- a/src/NzbDrone.Core/MediaFiles/MovieImport/Manual/ManualImportService.cs +++ b/src/NzbDrone.Core/MediaFiles/MovieImport/Manual/ManualImportService.cs @@ -336,7 +336,7 @@ private List ProcessDownloadDirectory(string rootFolder, List< return items; } - private bool SceneSource(Movie movie, string folder) + private static bool SceneSource(Movie movie, string folder) { return !(movie.Path.PathEquals(folder) || movie.Path.IsParentPath(folder)); } diff --git a/src/NzbDrone.Core/MetadataSource/SearchMovieComparer.cs b/src/NzbDrone.Core/MetadataSource/SearchMovieComparer.cs index dc23bba7fe..d354464524 100644 --- a/src/NzbDrone.Core/MetadataSource/SearchMovieComparer.cs +++ b/src/NzbDrone.Core/MetadataSource/SearchMovieComparer.cs @@ -75,7 +75,7 @@ public int Compare(Movie x, Movie y) return Compare(x, y, s => SearchQuery.LevenshteinDistanceClean(s.Title) - GetYearFactor(s)); } - public int Compare(Movie x, Movie y, Func keySelector) + public static int Compare(Movie x, Movie y, Func keySelector) where T : IComparable { var keyX = keySelector(x); @@ -106,14 +106,14 @@ public int CompareWithYear(Movie x, Movie y, Predicate canMatch) return matchX.CompareTo(matchY); } - private string CleanPunctuation(string title) + private static string CleanPunctuation(string title) { title = RegexCleanPunctuation.Replace(title, ""); return title.ToLowerInvariant(); } - private string CleanTitle(string title) + private static string CleanTitle(string title) { title = RegexCleanPunctuation.Replace(title, ""); title = RegexCleanCountryYearPostfix.Replace(title, ""); @@ -121,7 +121,7 @@ private string CleanTitle(string title) return title.ToLowerInvariant(); } - private string CleanArticles(string title) + private static string CleanArticles(string title) { title = ArticleRegex.Replace(title, ""); diff --git a/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs b/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs index 45fcb7f6cd..6368d6d4df 100644 --- a/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs +++ b/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs @@ -325,7 +325,7 @@ public MovieMetadata MapMovie(MovieResource resource) return movie; } - private string StripTrailingTheFromTitle(string title) + private static string StripTrailingTheFromTitle(string title) { if (title.EndsWith(",the")) { diff --git a/src/NzbDrone.Core/MovieStats/MovieStatisticsRepository.cs b/src/NzbDrone.Core/MovieStats/MovieStatisticsRepository.cs index 69505e1593..ac57177091 100644 --- a/src/NzbDrone.Core/MovieStats/MovieStatisticsRepository.cs +++ b/src/NzbDrone.Core/MovieStats/MovieStatisticsRepository.cs @@ -37,7 +37,7 @@ public List MovieStatistics(int movieId) Query(MovieFilesBuilder().Where(x => x.MovieId == movieId), _selectMovieFilesTemplate)); } - private List MapResults(List moviesResult, List filesResult) + private static List MapResults(List moviesResult, List filesResult) { moviesResult.ForEach(e => { diff --git a/src/NzbDrone.Core/Movies/Collections/AddMovieCollectionService.cs b/src/NzbDrone.Core/Movies/Collections/AddMovieCollectionService.cs index d1a1359de3..d19670b963 100644 --- a/src/NzbDrone.Core/Movies/Collections/AddMovieCollectionService.cs +++ b/src/NzbDrone.Core/Movies/Collections/AddMovieCollectionService.cs @@ -74,7 +74,7 @@ private MovieCollection AddSkyhookData(MovieCollection newCollection) return collection; } - private MovieCollection SetPropertiesAndValidate(MovieCollection newCollection) + private static MovieCollection SetPropertiesAndValidate(MovieCollection newCollection) { newCollection.CleanTitle = newCollection.Title.CleanMovieTitle(); newCollection.SortTitle = MovieTitleNormalizer.Normalize(newCollection.Title, newCollection.TmdbId); diff --git a/src/NzbDrone.Core/Movies/MovieRepository.cs b/src/NzbDrone.Core/Movies/MovieRepository.cs index ed235a30df..90e9b76c79 100644 --- a/src/NzbDrone.Core/Movies/MovieRepository.cs +++ b/src/NzbDrone.Core/Movies/MovieRepository.cs @@ -61,7 +61,7 @@ protected override IEnumerable PagedQuery(SqlBuilder builder) => .LeftJoin((m, f) => m.Id == f.MovieId) .LeftJoin((mm, t) => mm.Id == t.MovieMetadataId); - private Movie Map(Dictionary dict, Movie movie, MovieMetadata metadata, QualityProfile qualityProfile, MovieFile movieFile, AlternativeTitle altTitle = null, MovieTranslation translation = null) + private static Movie Map(Dictionary dict, Movie movie, MovieMetadata metadata, QualityProfile qualityProfile, MovieFile movieFile, AlternativeTitle altTitle = null, MovieTranslation translation = null) { if (!dict.TryGetValue(movie.Id, out var movieEntry)) { diff --git a/src/NzbDrone.Core/Movies/MovieService.cs b/src/NzbDrone.Core/Movies/MovieService.cs index e5248df2b7..60242f938d 100644 --- a/src/NzbDrone.Core/Movies/MovieService.cs +++ b/src/NzbDrone.Core/Movies/MovieService.cs @@ -421,7 +421,7 @@ public HashSet AllMovieWithCollectionsTmdbIds() return _movieRepository.AllMovieWithCollectionsTmdbIds(); } - private Movie ReturnSingleMovieOrThrow(List movies) + private static Movie ReturnSingleMovieOrThrow(List movies) { if (movies.Count == 0) { diff --git a/src/NzbDrone.Core/Notifications/CustomScript/CustomScript.cs b/src/NzbDrone.Core/Notifications/CustomScript/CustomScript.cs index b23653490d..93f756343f 100755 --- a/src/NzbDrone.Core/Notifications/CustomScript/CustomScript.cs +++ b/src/NzbDrone.Core/Notifications/CustomScript/CustomScript.cs @@ -381,7 +381,7 @@ private ProcessOutput ExecuteScript(StringDictionary environmentVariables) return processOutput; } - private bool ValidatePathParent(string possibleParent, string path) + private static bool ValidatePathParent(string possibleParent, string path) { return possibleParent.IsParentPath(path); } diff --git a/src/NzbDrone.Core/Notifications/Discord/Discord.cs b/src/NzbDrone.Core/Notifications/Discord/Discord.cs index e9f28825aa..c4f3cee64b 100644 --- a/src/NzbDrone.Core/Notifications/Discord/Discord.cs +++ b/src/NzbDrone.Core/Notifications/Discord/Discord.cs @@ -637,7 +637,7 @@ private static string GetLinksString(Movie movie) return string.Join(" / ", links); } - private string GetTitle(Movie movie) + private static string GetTitle(Movie movie) { if (movie == null) { diff --git a/src/NzbDrone.Core/Notifications/Mailgun/MailgunProxy.cs b/src/NzbDrone.Core/Notifications/Mailgun/MailgunProxy.cs index 8bd1796a03..e350840bdc 100644 --- a/src/NzbDrone.Core/Notifications/Mailgun/MailgunProxy.cs +++ b/src/NzbDrone.Core/Notifications/Mailgun/MailgunProxy.cs @@ -43,7 +43,7 @@ public void SendNotification(string title, string message, MailgunSettings setti } } - private HttpRequestBuilder BuildRequest(MailgunSettings settings, string resource, HttpMethod method, string messageSubject, string messageBody) + private static HttpRequestBuilder BuildRequest(MailgunSettings settings, string resource, HttpMethod method, string messageSubject, string messageBody) { var loginCredentials = new NetworkCredential("api", settings.ApiKey); var url = settings.UseEuEndpoint ? BaseUrlEu : BaseUrlUs; diff --git a/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowserProxy.cs b/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowserProxy.cs index 8af5104ec7..2d817de01e 100644 --- a/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowserProxy.cs +++ b/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowserProxy.cs @@ -152,7 +152,7 @@ private string ProcessRequest(HttpRequest request, MediaBrowserSettings settings return response.Content; } - private string GetUrl(MediaBrowserSettings settings) + private static string GetUrl(MediaBrowserSettings settings) { var scheme = settings.UseSsl ? "https" : "http"; return $@"{scheme}://{settings.Address}"; diff --git a/src/NzbDrone.Core/Notifications/NotificationService.cs b/src/NzbDrone.Core/Notifications/NotificationService.cs index ba43d98f35..d7d22f50d0 100644 --- a/src/NzbDrone.Core/Notifications/NotificationService.cs +++ b/src/NzbDrone.Core/Notifications/NotificationService.cs @@ -42,7 +42,7 @@ public NotificationService(INotificationFactory notificationFactory, INotificati _logger = logger; } - private string GetMessage(Movie movie, QualityModel quality) + private static string GetMessage(Movie movie, QualityModel quality) { var qualityString = quality.Quality.ToString(); var imdbUrl = "https://www.imdb.com/title/" + movie.MovieMetadata.Value.ImdbId + "/"; @@ -78,7 +78,7 @@ private bool ShouldHandleMovie(ProviderDefinition definition, Movie movie) return false; } - private bool ShouldHandleHealthFailure(HealthCheck.HealthCheck healthCheck, bool includeWarnings) + private static bool ShouldHandleHealthFailure(HealthCheck.HealthCheck healthCheck, bool includeWarnings) { if (healthCheck.Type == HealthCheckResult.Error) { diff --git a/src/NzbDrone.Core/Notifications/Ntfy/NtfyProxy.cs b/src/NzbDrone.Core/Notifications/Ntfy/NtfyProxy.cs index 1fb3dc4444..267d4e6e0a 100644 --- a/src/NzbDrone.Core/Notifications/Ntfy/NtfyProxy.cs +++ b/src/NzbDrone.Core/Notifications/Ntfy/NtfyProxy.cs @@ -59,7 +59,7 @@ public void SendNotification(string title, string message, NtfySettings settings } } - private HttpRequestBuilder BuildTopicRequest(string serverUrl, string topic) + private static HttpRequestBuilder BuildTopicRequest(string serverUrl, string topic) { var trimServerUrl = serverUrl.TrimEnd('/'); diff --git a/src/NzbDrone.Core/Notifications/Plex/PlexTv/PlexTvProxy.cs b/src/NzbDrone.Core/Notifications/Plex/PlexTv/PlexTvProxy.cs index 199ae0a597..2290376fef 100644 --- a/src/NzbDrone.Core/Notifications/Plex/PlexTv/PlexTvProxy.cs +++ b/src/NzbDrone.Core/Notifications/Plex/PlexTv/PlexTvProxy.cs @@ -90,7 +90,7 @@ public List GetResources(string clientIdentifier, string authTok return new List(); } - private HttpRequestBuilder BuildRequest(string clientIdentifier) + private static HttpRequestBuilder BuildRequest(string clientIdentifier) { var requestBuilder = new HttpRequestBuilder("https://plex.tv") .Accept(HttpAccept.Json) diff --git a/src/NzbDrone.Core/Notifications/Plex/Server/PlexServerService.cs b/src/NzbDrone.Core/Notifications/Plex/Server/PlexServerService.cs index 63c0c7c216..698d2d3bcd 100644 --- a/src/NzbDrone.Core/Notifications/Plex/Server/PlexServerService.cs +++ b/src/NzbDrone.Core/Notifications/Plex/Server/PlexServerService.cs @@ -77,7 +77,7 @@ private List GetSections(PlexServerSettings settings) return _plexServerProxy.GetMovieSections(settings).ToList(); } - private void ValidateVersion(Version version) + private static void ValidateVersion(Version version) { if (version >= new Version(1, 3, 0) && version < new Version(1, 3, 1)) { diff --git a/src/NzbDrone.Core/Notifications/PushBullet/PushBulletProxy.cs b/src/NzbDrone.Core/Notifications/PushBullet/PushBulletProxy.cs index 4457857721..49e3c53dd9 100644 --- a/src/NzbDrone.Core/Notifications/PushBullet/PushBulletProxy.cs +++ b/src/NzbDrone.Core/Notifications/PushBullet/PushBulletProxy.cs @@ -152,7 +152,7 @@ public ValidationFailure Test(PushBulletSettings settings) return null; } - private HttpRequestBuilder BuildDeviceRequest(string deviceId) + private static HttpRequestBuilder BuildDeviceRequest(string deviceId) { var requestBuilder = new HttpRequestBuilder(PUSH_URL).Post(); @@ -173,7 +173,7 @@ private HttpRequestBuilder BuildDeviceRequest(string deviceId) return requestBuilder; } - private HttpRequestBuilder BuildChannelRequest(string channelTag) + private static HttpRequestBuilder BuildChannelRequest(string channelTag) { var requestBuilder = new HttpRequestBuilder(PUSH_URL).Post(); diff --git a/src/NzbDrone.Core/Notifications/Pushcut/Pushcut.cs b/src/NzbDrone.Core/Notifications/Pushcut/Pushcut.cs index 1451b4bec2..717de132d6 100644 --- a/src/NzbDrone.Core/Notifications/Pushcut/Pushcut.cs +++ b/src/NzbDrone.Core/Notifications/Pushcut/Pushcut.cs @@ -74,7 +74,7 @@ public override void OnManualInteractionRequired(ManualInteractionRequiredMessag _proxy.SendNotification(MANUAL_INTERACTION_REQUIRED_TITLE_BRANDED, manualInteractionRequiredMessage.Message, null, new List(), Settings); } - private string GetPosterUrl(Movie movie) + private static string GetPosterUrl(Movie movie) { return movie.MovieMetadata.Value.Images.FirstOrDefault(x => x.CoverType == MediaCoverTypes.Poster)?.RemoteUrl; } diff --git a/src/NzbDrone.Core/Notifications/SendGrid/SendGridProxy.cs b/src/NzbDrone.Core/Notifications/SendGrid/SendGridProxy.cs index 6a3b41ca9f..b79d5aa509 100644 --- a/src/NzbDrone.Core/Notifications/SendGrid/SendGridProxy.cs +++ b/src/NzbDrone.Core/Notifications/SendGrid/SendGridProxy.cs @@ -69,7 +69,7 @@ public void SendNotification(string title, string message, SendGridSettings sett } } - private HttpRequest BuildRequest(SendGridSettings settings, string resource, HttpMethod method) + private static HttpRequest BuildRequest(SendGridSettings settings, string resource, HttpMethod method) { var request = new HttpRequestBuilder(settings.BaseUrl).Resource(resource) .SetHeader("Authorization", $"Bearer {settings.ApiKey}") diff --git a/src/NzbDrone.Core/Notifications/Synology/SynologyIndexerProxy.cs b/src/NzbDrone.Core/Notifications/Synology/SynologyIndexerProxy.cs index 89d2135674..5b35535615 100644 --- a/src/NzbDrone.Core/Notifications/Synology/SynologyIndexerProxy.cs +++ b/src/NzbDrone.Core/Notifications/Synology/SynologyIndexerProxy.cs @@ -87,7 +87,7 @@ private void ExecuteCommand(string args, bool throwOnStdOut = true) } } - private string Escape(string arg) + private static string Escape(string arg) { return string.Format("\"{0}\"", arg.Replace("\"", "\\\"")); } diff --git a/src/NzbDrone.Core/Notifications/Trakt/Trakt.cs b/src/NzbDrone.Core/Notifications/Trakt/Trakt.cs index 078e650607..bcf3cfe333 100644 --- a/src/NzbDrone.Core/Notifications/Trakt/Trakt.cs +++ b/src/NzbDrone.Core/Notifications/Trakt/Trakt.cs @@ -204,7 +204,7 @@ private void RemoveMovieFromCollection(TraktSettings settings, Movie movie) _proxy.RemoveFromCollection(payload, settings.AccessToken); } - private string MapMediaType(QualitySource source) + private static string MapMediaType(QualitySource source) { var traktSource = source switch { @@ -219,7 +219,7 @@ private string MapMediaType(QualitySource source) return traktSource; } - private string MapResolution(int resolution, string scanType) + private static string MapResolution(int resolution, string scanType) { var scanIdentifier = scanType.IsNotNullOrWhiteSpace() && TraktInterlacedTypes.InterlacedTypes.Contains(scanType) ? "i" : "p"; @@ -236,7 +236,7 @@ private string MapResolution(int resolution, string scanType) return traktResolution; } - private string MapHdr(MovieFile movieFile) + private static string MapHdr(MovieFile movieFile) { var traktHdr = movieFile.MediaInfo?.VideoHdrFormat switch { @@ -250,7 +250,7 @@ private string MapHdr(MovieFile movieFile) return traktHdr; } - private string MapAudio(MovieFile movieFile) + private static string MapAudio(MovieFile movieFile) { var audioCodec = movieFile.MediaInfo != null ? MediaInfoFormatter.FormatAudioCodec(movieFile.MediaInfo, movieFile.SceneName) : string.Empty; @@ -280,7 +280,7 @@ private string MapAudio(MovieFile movieFile) return traktAudioFormat; } - private string MapAudioChannels(MovieFile movieFile) + private static string MapAudioChannels(MovieFile movieFile) { var audioChannels = movieFile.MediaInfo != null ? MediaInfoFormatter.FormatAudioChannels(movieFile.MediaInfo).ToString("0.0") : string.Empty; diff --git a/src/NzbDrone.Core/Notifications/Twitter/TwitterProxy.cs b/src/NzbDrone.Core/Notifications/Twitter/TwitterProxy.cs index 3330e4a07c..9331529733 100644 --- a/src/NzbDrone.Core/Notifications/Twitter/TwitterProxy.cs +++ b/src/NzbDrone.Core/Notifications/Twitter/TwitterProxy.cs @@ -85,12 +85,12 @@ public void DirectMessage(string message, TwitterSettings settings) ExecuteRequest(request); } - private string GetCustomParametersString(Dictionary customParams) + private static string GetCustomParametersString(Dictionary customParams) { return customParams.Select(x => string.Format("{0}={1}", x.Key, x.Value)).Join("&"); } - private HttpRequest GetRequest(OAuthRequest oAuthRequest, Dictionary customParams) + private static HttpRequest GetRequest(OAuthRequest oAuthRequest, Dictionary customParams) { var auth = oAuthRequest.GetAuthorizationHeader(customParams); var request = new HttpRequest(oAuthRequest.RequestUrl); diff --git a/src/NzbDrone.Core/Organizer/FileNameBuilder.cs b/src/NzbDrone.Core/Organizer/FileNameBuilder.cs index 24d69c7cb4..401e81f1eb 100644 --- a/src/NzbDrone.Core/Organizer/FileNameBuilder.cs +++ b/src/NzbDrone.Core/Organizer/FileNameBuilder.cs @@ -317,7 +317,7 @@ private void AddEditionTagsTokens(Dictionary> t } } - private void AddReleaseDateTokens(Dictionary> tokenHandlers, int releaseYear) + private static void AddReleaseDateTokens(Dictionary> tokenHandlers, int releaseYear) { if (releaseYear == 0) { @@ -328,7 +328,7 @@ private void AddReleaseDateTokens(Dictionary> t tokenHandlers["{Release Year}"] = m => string.Format("{0}", releaseYear.ToString()); // Do I need m.CustomFormat? } - private void AddIdTokens(Dictionary> tokenHandlers, Movie movie) + private static void AddIdTokens(Dictionary> tokenHandlers, Movie movie) { tokenHandlers["{ImdbId}"] = m => movie.MovieMetadata.Value.ImdbId ?? string.Empty; tokenHandlers["{TmdbId}"] = m => movie.MovieMetadata.Value.TmdbId.ToString(); @@ -437,7 +437,7 @@ private void AddCustomFormats(Dictionary> token }; } - private string GetCustomFormatsToken(List customFormats, string filter) + private static string GetCustomFormatsToken(List customFormats, string filter) { var tokens = customFormats.Where(x => x.IncludeCustomFormatWhenRenaming).ToList(); @@ -460,7 +460,7 @@ private string GetCustomFormatsToken(List customFormats, string fi return string.Join(" ", filteredTokens); } - private string GetLanguagesToken(List mediaInfoLanguages, string filter, bool skipEnglishOnly, bool quoted) + private static string GetLanguagesToken(List mediaInfoLanguages, string filter, bool skipEnglishOnly, bool quoted) { var tokens = new List(); foreach (var item in mediaInfoLanguages) @@ -529,7 +529,7 @@ private string GetLanguagesToken(List mediaInfoLanguages, string filter, } } - private string GetEditionToken(MovieFile movieFile) + private static string GetEditionToken(MovieFile movieFile) { var edition = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(movieFile.Edition.ToLowerInvariant()); @@ -610,7 +610,7 @@ private string ReplaceToken(Match match, Dictionary 1) { @@ -631,7 +631,7 @@ private string GetQualityProper(Movie movie, QualityModel quality) return string.Empty; } - private string GetQualityReal(Movie movie, QualityModel quality) + private static string GetQualityReal(Movie movie, QualityModel quality) { if (quality.Revision.Real > 0) { @@ -651,7 +651,7 @@ private string GetOriginalTitle(MovieFile movieFile, bool multipleTokens) return CleanFileName(movieFile.SceneName); } - private string GetOriginalFileName(MovieFile movieFile, bool multipleTokens) + private static string GetOriginalFileName(MovieFile movieFile, bool multipleTokens) { if (multipleTokens) { @@ -666,7 +666,7 @@ private string GetOriginalFileName(MovieFile movieFile, bool multipleTokens) return Path.GetFileNameWithoutExtension(movieFile.RelativePath); } - private string ReplaceReservedDeviceNames(string input) + private static string ReplaceReservedDeviceNames(string input) { // Replace reserved windows device names with an alternative return ReservedDeviceNamesRegex.Replace(input, match => match.Value.Replace(".", "_")); @@ -739,7 +739,7 @@ private string Truncate(string input, string formatter) return $"{input.Truncate(maxLength - 3).TrimEnd(' ', '.')}{{ellipsis}}"; } - private int GetMaxLengthFromFormatter(string formatter) + private static int GetMaxLengthFromFormatter(string formatter) { int.TryParse(formatter, out var maxCustomLength); diff --git a/src/NzbDrone.Core/Parser/ParsingService.cs b/src/NzbDrone.Core/Parser/ParsingService.cs index cd406d50c7..b3b411edc3 100644 --- a/src/NzbDrone.Core/Parser/ParsingService.cs +++ b/src/NzbDrone.Core/Parser/ParsingService.cs @@ -209,7 +209,7 @@ private FindMovieResult TryGetMovieByTitleAndOrYear(ParsedMovieInfo parsedMovieI return null; } - private FindMovieResult TryGetMovieBySearchCriteria(ParsedMovieInfo parsedMovieInfo, string imdbId, int tmdbId, SearchCriteriaBase searchCriteria) + private static FindMovieResult TryGetMovieBySearchCriteria(ParsedMovieInfo parsedMovieInfo, string imdbId, int tmdbId, SearchCriteriaBase searchCriteria) { Movie possibleMovie = null; diff --git a/src/NzbDrone.Core/Profiles/Delay/DelayProfileService.cs b/src/NzbDrone.Core/Profiles/Delay/DelayProfileService.cs index b71f80dd4f..93bbf6d032 100644 --- a/src/NzbDrone.Core/Profiles/Delay/DelayProfileService.cs +++ b/src/NzbDrone.Core/Profiles/Delay/DelayProfileService.cs @@ -150,7 +150,7 @@ public List Reorder(int id, int? afterId) return All(); } - private int GetAfterOrder(DelayProfile moving, DelayProfile after) + private static int GetAfterOrder(DelayProfile moving, DelayProfile after) { if (after == null) { diff --git a/src/NzbDrone.Core/Profiles/Releases/TermMatcherService.cs b/src/NzbDrone.Core/Profiles/Releases/TermMatcherService.cs index 69df8e4503..0f88c92761 100644 --- a/src/NzbDrone.Core/Profiles/Releases/TermMatcherService.cs +++ b/src/NzbDrone.Core/Profiles/Releases/TermMatcherService.cs @@ -34,7 +34,7 @@ public ITermMatcher GetMatcher(string term) return _matcherCache.Get(term, () => CreateMatcherInternal(term), TimeSpan.FromHours(24)); } - private ITermMatcher CreateMatcherInternal(string term) + private static ITermMatcher CreateMatcherInternal(string term) { if (PerlRegexFactory.TryCreateRegex(term, out var regex)) { diff --git a/src/NzbDrone.Core/ProgressMessaging/ProgressMessageTarget.cs b/src/NzbDrone.Core/ProgressMessaging/ProgressMessageTarget.cs index 37885c47dc..e1a51cd0ac 100644 --- a/src/NzbDrone.Core/ProgressMessaging/ProgressMessageTarget.cs +++ b/src/NzbDrone.Core/ProgressMessaging/ProgressMessageTarget.cs @@ -44,7 +44,7 @@ protected override void Write(LogEventInfo logEvent) } } - private bool IsClientMessage(LogEventInfo logEvent, CommandModel command) + private static bool IsClientMessage(LogEventInfo logEvent, CommandModel command) { if (command == null || !command.Body.SendUpdatesToClient) { diff --git a/src/NzbDrone.Core/Security/X509CertificateValidationService.cs b/src/NzbDrone.Core/Security/X509CertificateValidationService.cs index 41d1cdf604..1816f605d8 100644 --- a/src/NzbDrone.Core/Security/X509CertificateValidationService.cs +++ b/src/NzbDrone.Core/Security/X509CertificateValidationService.cs @@ -75,7 +75,7 @@ public bool ShouldByPassValidationError(object sender, X509Certificate certifica return false; } - private IPAddress[] GetIPAddresses(string host) + private static IPAddress[] GetIPAddresses(string host) { if (IPAddress.TryParse(host, out var ipAddress)) { diff --git a/src/NzbDrone.Core/Tags/TagService.cs b/src/NzbDrone.Core/Tags/TagService.cs index 93c85fe369..90c23e0153 100644 --- a/src/NzbDrone.Core/Tags/TagService.cs +++ b/src/NzbDrone.Core/Tags/TagService.cs @@ -190,7 +190,7 @@ public void Delete(int tagId) _eventAggregator.PublishEvent(new TagsUpdatedEvent()); } - private List GetAutoTagIds(Tag tag, List autoTags) + private static List GetAutoTagIds(Tag tag, List autoTags) { var autoTagIds = autoTags.Where(c => c.Tags.Contains(tag.Id)).Select(c => c.Id).ToList(); diff --git a/src/NzbDrone.Host/CancelHandler.cs b/src/NzbDrone.Host/CancelHandler.cs index fbe142c816..82e373df8b 100644 --- a/src/NzbDrone.Host/CancelHandler.cs +++ b/src/NzbDrone.Host/CancelHandler.cs @@ -57,7 +57,7 @@ private void GracefulShutdown() _lifecycleService.Shutdown(); } - private void UngracefulShutdown() + private static void UngracefulShutdown() { Console.WriteLine("Termination requested."); diff --git a/src/NzbDrone.Host/Startup.cs b/src/NzbDrone.Host/Startup.cs index eebf6f08d9..e2b2d5a8ab 100644 --- a/src/NzbDrone.Host/Startup.cs +++ b/src/NzbDrone.Host/Startup.cs @@ -306,7 +306,7 @@ public void Configure(IApplicationBuilder app, }); } - private void EnsureSingleInstance(bool isService, IStartupContext startupContext, ISingleInstancePolicy instancePolicy) + private static void EnsureSingleInstance(bool isService, IStartupContext startupContext, ISingleInstancePolicy instancePolicy) { if (startupContext.Flags.Contains(StartupContext.NO_SINGLE_INSTANCE_CHECK)) { diff --git a/src/NzbDrone.Integration.Test/ApiTests/IndexerFixture.cs b/src/NzbDrone.Integration.Test/ApiTests/IndexerFixture.cs index 9acb6a5a38..ca8dd9d62e 100644 --- a/src/NzbDrone.Integration.Test/ApiTests/IndexerFixture.cs +++ b/src/NzbDrone.Integration.Test/ApiTests/IndexerFixture.cs @@ -46,7 +46,7 @@ private IndexerResource GetNewznabSchemav3(string name = null) return schema; } - private Field GetCategoriesField(IndexerResource resource) + private static Field GetCategoriesField(IndexerResource resource) { var field = resource.Fields.First(v => v.Name == "categories"); diff --git a/src/NzbDrone.Integration.Test/ApiTests/ReleaseFixture.cs b/src/NzbDrone.Integration.Test/ApiTests/ReleaseFixture.cs index 8c4fdfb3f4..3cc7c8ccea 100644 --- a/src/NzbDrone.Integration.Test/ApiTests/ReleaseFixture.cs +++ b/src/NzbDrone.Integration.Test/ApiTests/ReleaseFixture.cs @@ -41,7 +41,7 @@ public void should_accept_request_with_only_guid_supplied() var result = Releases.Post(new ReleaseResource { Guid = releases.First().Guid }, HttpStatusCode.InternalServerError); } - private bool BeValidRelease(ReleaseResource releaseResource) + private static bool BeValidRelease(ReleaseResource releaseResource) { releaseResource.Guid.Should().NotBeNullOrEmpty(); releaseResource.Age.Should().BeGreaterOrEqualTo(-1); diff --git a/src/NzbDrone.Integration.Test/CorsFixture.cs b/src/NzbDrone.Integration.Test/CorsFixture.cs index ed5a178ac5..be59415077 100644 --- a/src/NzbDrone.Integration.Test/CorsFixture.cs +++ b/src/NzbDrone.Integration.Test/CorsFixture.cs @@ -8,7 +8,7 @@ namespace NzbDrone.Integration.Test [TestFixture] public class CorsFixture : IntegrationTest { - private RestRequest BuildGet(string route = "movie") + private static RestRequest BuildGet(string route = "movie") { var request = new RestRequest(route, Method.GET); request.AddHeader("Origin", "http://a.different.domain"); @@ -17,7 +17,7 @@ private RestRequest BuildGet(string route = "movie") return request; } - private RestRequest BuildOptions(string route = "movie") + private static RestRequest BuildOptions(string route = "movie") { var request = new RestRequest(route, Method.OPTIONS); request.AddHeader("Origin", "http://a.different.domain"); diff --git a/src/NzbDrone.Mono.Test/DiskProviderTests/DiskProviderFixture.cs b/src/NzbDrone.Mono.Test/DiskProviderTests/DiskProviderFixture.cs index a09a68a98b..cfc56b8382 100644 --- a/src/NzbDrone.Mono.Test/DiskProviderTests/DiskProviderFixture.cs +++ b/src/NzbDrone.Mono.Test/DiskProviderTests/DiskProviderFixture.cs @@ -54,7 +54,7 @@ protected override void SetWritePermissions(string path, bool writable) SetWritePermissionsInternal(path, writable, false); } - protected void SetWritePermissionsInternal(string path, bool writable, bool setgid) + protected static void SetWritePermissionsInternal(string path, bool writable, bool setgid) { // Remove Write permissions, we're still owner so we can clean it up, but we'll have to do that explicitly. Syscall.stat(path, out var stat); diff --git a/src/NzbDrone.Mono/Disk/DiskProvider.cs b/src/NzbDrone.Mono/Disk/DiskProvider.cs index a44966bc53..707a2fc9e0 100644 --- a/src/NzbDrone.Mono/Disk/DiskProvider.cs +++ b/src/NzbDrone.Mono/Disk/DiskProvider.cs @@ -469,7 +469,7 @@ public override bool TryCreateRefLink(string source, string destination) return _createRefLink.TryCreateRefLink(source, destination); } - private uint GetUserId(string user) + private static uint GetUserId(string user) { if (user.IsNullOrWhiteSpace()) { @@ -491,7 +491,7 @@ private uint GetUserId(string user) return u.pw_uid; } - private uint GetGroupId(string group) + private static uint GetGroupId(string group) { if (group.IsNullOrWhiteSpace()) { diff --git a/src/NzbDrone.Mono/Disk/ProcMountProvider.cs b/src/NzbDrone.Mono/Disk/ProcMountProvider.cs index 2cce7d8b64..7f8b8d1885 100644 --- a/src/NzbDrone.Mono/Disk/ProcMountProvider.cs +++ b/src/NzbDrone.Mono/Disk/ProcMountProvider.cs @@ -147,7 +147,7 @@ private Dictionary ParseOptions(string options) return result; } - private string ExpandEscapes(string mount) + private static string ExpandEscapes(string mount) { return OctalRegex.Replace(mount, match => match.Captures[0].Value.FromOctalString()); } diff --git a/src/NzbDrone.Update/UpdateApp.cs b/src/NzbDrone.Update/UpdateApp.cs index 176b419097..9a9f0ba620 100644 --- a/src/NzbDrone.Update/UpdateApp.cs +++ b/src/NzbDrone.Update/UpdateApp.cs @@ -97,7 +97,7 @@ private UpdateStartupContext ParseArgs(string[] args) return startupContext; } - private int ParseProcessId(string arg) + private static int ParseProcessId(string arg) { if (!int.TryParse(arg, out var id) || id <= 0) { diff --git a/src/NzbDrone.Windows/Disk/DiskProvider.cs b/src/NzbDrone.Windows/Disk/DiskProvider.cs index a7a204a5e8..1cabb5c1aa 100644 --- a/src/NzbDrone.Windows/Disk/DiskProvider.cs +++ b/src/NzbDrone.Windows/Disk/DiskProvider.cs @@ -184,7 +184,7 @@ public override bool TryCreateHardLink(string source, string destination) } } - private IMount GetReparsePoint(string path) + private static IMount GetReparsePoint(string path) { if (!Directory.Exists(path)) { diff --git a/src/Radarr.Api.V3/AutoTagging/AutoTaggingController.cs b/src/Radarr.Api.V3/AutoTagging/AutoTaggingController.cs index ca112e41df..2ffc9cffa3 100644 --- a/src/Radarr.Api.V3/AutoTagging/AutoTaggingController.cs +++ b/src/Radarr.Api.V3/AutoTagging/AutoTaggingController.cs @@ -102,7 +102,7 @@ private void Validate(AutoTag definition) } } - private void VerifyValidationResult(ValidationResult validationResult) + private static void VerifyValidationResult(ValidationResult validationResult) { var result = new NzbDroneValidationResult(validationResult.Errors); diff --git a/src/Radarr.Api.V3/Calendar/CalendarFeedController.cs b/src/Radarr.Api.V3/Calendar/CalendarFeedController.cs index e7f1634649..271e3ba24b 100644 --- a/src/Radarr.Api.V3/Calendar/CalendarFeedController.cs +++ b/src/Radarr.Api.V3/Calendar/CalendarFeedController.cs @@ -76,7 +76,7 @@ public IActionResult GetCalendarFeed(int pastDays = 7, int futureDays = 28, stri return Content(icalendar, "text/calendar"); } - private void CreateEvent(Ical.Net.Calendar calendar, MovieMetadata movie, string releaseType) + private static void CreateEvent(Ical.Net.Calendar calendar, MovieMetadata movie, string releaseType) { var date = movie.InCinemas; var eventType = "_cinemas"; diff --git a/src/Radarr.Api.V3/CustomFormats/CustomFormatController.cs b/src/Radarr.Api.V3/CustomFormats/CustomFormatController.cs index 5adbaeeec4..fd04d841af 100644 --- a/src/Radarr.Api.V3/CustomFormats/CustomFormatController.cs +++ b/src/Radarr.Api.V3/CustomFormats/CustomFormatController.cs @@ -138,7 +138,7 @@ private void Validate(CustomFormat definition) } } - protected void VerifyValidationResult(ValidationResult validationResult) + protected static void VerifyValidationResult(ValidationResult validationResult) { var result = new NzbDroneValidationResult(validationResult.Errors); diff --git a/src/Radarr.Api.V3/Indexers/ReleaseController.cs b/src/Radarr.Api.V3/Indexers/ReleaseController.cs index c5f991b5b5..68bcf445f5 100644 --- a/src/Radarr.Api.V3/Indexers/ReleaseController.cs +++ b/src/Radarr.Api.V3/Indexers/ReleaseController.cs @@ -173,7 +173,7 @@ protected override ReleaseResource MapDecision(DownloadDecision decision, int in return resource; } - private string GetCacheKey(ReleaseResource resource) + private static string GetCacheKey(ReleaseResource resource) { return string.Concat(resource.IndexerId, "_", resource.Guid); } diff --git a/src/Radarr.Api.V3/ManualImport/ManualImportController.cs b/src/Radarr.Api.V3/ManualImport/ManualImportController.cs index 8215ab4396..f8396ad40b 100644 --- a/src/Radarr.Api.V3/ManualImport/ManualImportController.cs +++ b/src/Radarr.Api.V3/ManualImport/ManualImportController.cs @@ -73,7 +73,7 @@ public object ReprocessItems([FromBody] List item return items; } - private ManualImportResource AddQualityWeight(ManualImportResource item) + private static ManualImportResource AddQualityWeight(ManualImportResource item) { if (item.Quality != null) { diff --git a/src/Radarr.Api.V3/Movies/MovieController.cs b/src/Radarr.Api.V3/Movies/MovieController.cs index 7bc3ea3c12..444f9af48c 100644 --- a/src/Radarr.Api.V3/Movies/MovieController.cs +++ b/src/Radarr.Api.V3/Movies/MovieController.cs @@ -308,7 +308,7 @@ private void LinkMovieStatistics(List resources, Dictionary 0; diff --git a/src/Radarr.Api.V3/Movies/MovieControllerWithSignalR.cs b/src/Radarr.Api.V3/Movies/MovieControllerWithSignalR.cs index 54c7e55c45..ad23e4d547 100644 --- a/src/Radarr.Api.V3/Movies/MovieControllerWithSignalR.cs +++ b/src/Radarr.Api.V3/Movies/MovieControllerWithSignalR.cs @@ -134,7 +134,7 @@ private void FetchAndLinkMovieStatistics(MovieResource resource) LinkMovieStatistics(resource, _movieStatisticsService.MovieStatistics(resource.Id)); } - private void LinkMovieStatistics(MovieResource resource, MovieStatistics movieStatistics) + private static void LinkMovieStatistics(MovieResource resource, MovieStatistics movieStatistics) { resource.Statistics = movieStatistics.ToResource(); resource.HasFile = movieStatistics.MovieFileCount > 0; diff --git a/src/Radarr.Api.V3/ProviderControllerBase.cs b/src/Radarr.Api.V3/ProviderControllerBase.cs index b431397a8f..a9e2b0cc2e 100644 --- a/src/Radarr.Api.V3/ProviderControllerBase.cs +++ b/src/Radarr.Api.V3/ProviderControllerBase.cs @@ -304,7 +304,7 @@ protected virtual void Test(TProviderDefinition definition, bool includeWarnings VerifyValidationResult(validationResult, includeWarnings); } - protected void VerifyValidationResult(ValidationResult validationResult, bool includeWarnings) + protected static void VerifyValidationResult(ValidationResult validationResult, bool includeWarnings) { var result = validationResult as NzbDroneValidationResult ?? new NzbDroneValidationResult(validationResult.Errors); diff --git a/src/Radarr.Api.V3/Queue/QueueController.cs b/src/Radarr.Api.V3/Queue/QueueController.cs index 31377f4ed6..061e359528 100644 --- a/src/Radarr.Api.V3/Queue/QueueController.cs +++ b/src/Radarr.Api.V3/Queue/QueueController.cs @@ -376,7 +376,7 @@ private TrackedDownload GetTrackedDownload(int queueId) return trackedDownload; } - private QueueResource MapToResource(NzbDrone.Core.Queue.Queue queueItem, bool includeMovie) + private static QueueResource MapToResource(NzbDrone.Core.Queue.Queue queueItem, bool includeMovie) { return queueItem.ToResource(includeMovie); } diff --git a/src/Radarr.Api.V3/System/Backup/BackupController.cs b/src/Radarr.Api.V3/System/Backup/BackupController.cs index a7c76cc0d0..ed1a062f56 100644 --- a/src/Radarr.Api.V3/System/Backup/BackupController.cs +++ b/src/Radarr.Api.V3/System/Backup/BackupController.cs @@ -129,7 +129,7 @@ private string GetBackupPath(NzbDrone.Core.Backup.Backup backup) return Path.Combine(_backupService.GetBackupFolder(backup.Type), backup.Name); } - private int GetBackupId(NzbDrone.Core.Backup.Backup backup) + private static int GetBackupId(NzbDrone.Core.Backup.Backup backup) { return HashConverter.GetHashInt31($"backup-{backup.Type}-{backup.Name}"); } diff --git a/src/Radarr.Http/Authentication/AuthenticationService.cs b/src/Radarr.Http/Authentication/AuthenticationService.cs index fb83fa50ef..594105e9aa 100644 --- a/src/Radarr.Http/Authentication/AuthenticationService.cs +++ b/src/Radarr.Http/Authentication/AuthenticationService.cs @@ -65,22 +65,22 @@ public void LogUnauthorized(HttpRequest context) _authLogger.Info("Auth-Unauthorized ip {0} url '{1}'", context.GetRemoteIP(), context.Path); } - private void LogInvalidated(HttpRequest context) + private static void LogInvalidated(HttpRequest context) { _authLogger.Info("Auth-Invalidated ip {0}", context.GetRemoteIP()); } - private void LogFailure(HttpRequest context, string username) + private static void LogFailure(HttpRequest context, string username) { _authLogger.Warn("Auth-Failure ip {0} username '{1}'", context.GetRemoteIP(), username); } - private void LogSuccess(HttpRequest context, string username) + private static void LogSuccess(HttpRequest context, string username) { _authLogger.Debug("Auth-Success ip {0} username '{1}'", context.GetRemoteIP(), username); } - private void LogLogout(HttpRequest context, string username) + private static void LogLogout(HttpRequest context, string username) { _authLogger.Info("Auth-Logout ip {0} username '{1}'", context.GetRemoteIP(), username); } diff --git a/src/Radarr.Http/Middleware/LoggingMiddleware.cs b/src/Radarr.Http/Middleware/LoggingMiddleware.cs index 2cbac8a5f5..438875ec8d 100644 --- a/src/Radarr.Http/Middleware/LoggingMiddleware.cs +++ b/src/Radarr.Http/Middleware/LoggingMiddleware.cs @@ -35,7 +35,7 @@ public async Task InvokeAsync(HttpContext context) LogEnd(context); } - private void LogStart(HttpContext context) + private static void LogStart(HttpContext context) { var id = Interlocked.Increment(ref _requestSequenceID); @@ -47,7 +47,7 @@ private void LogStart(HttpContext context) _loggerHttp.Trace("Req: {0} [{1}] {2} (from {3})", id, context.Request.Method, reqPath, GetOrigin(context)); } - private void LogEnd(HttpContext context) + private static void LogEnd(HttpContext context) { var id = (int)context.Items["ApiRequestSequenceID"]; var startTime = (DateTime)context.Items["ApiRequestStartTime"]; diff --git a/src/Radarr.Http/REST/RestController.cs b/src/Radarr.Http/REST/RestController.cs index a87ed04049..86f1bcf9f9 100644 --- a/src/Radarr.Http/REST/RestController.cs +++ b/src/Radarr.Http/REST/RestController.cs @@ -27,7 +27,7 @@ public abstract class RestController : Controller protected ResourceValidator PutValidator { get; private set; } protected ResourceValidator SharedValidator { get; private set; } - protected void ValidateId(int id) + protected static void ValidateId(int id) { if (id <= 0) {