refactor: make methods static where instance data not used (S2325)

~243 methods converted to static where they don't access instance data.
Fixed call sites that needed to use type name instead of instance.
This commit is contained in:
admin 2025-12-18 16:02:13 -06:00
parent aa748bfaa6
commit b5bcb14d75
174 changed files with 247 additions and 247 deletions

View file

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

View file

@ -47,7 +47,7 @@ public void Setup()
_subject = new SentryTarget("https://aaaaaaaaaaaaaaaaaaaaaaaaaa@sentry.io/111111", Mocker.GetMock<IAppFolderInfo>().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);
}

View file

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

View file

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

View file

@ -539,7 +539,7 @@ public virtual IMount GetMount(string path)
}
}
protected List<DriveInfo> GetDriveInfoMounts()
protected static List<DriveInfo> GetDriveInfoMounts()
{
return DriveInfo.GetDrives()
.Where(d => d.IsReady)

View file

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

View file

@ -377,7 +377,7 @@ public HttpResponse<T> Post<T>(HttpRequest request)
return Task.Run(() => PostAsync<T>(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"))
{

View file

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

View file

@ -47,7 +47,7 @@ private IWebProxy CreateWebProxy(HttpProxySettings proxySettings)
}
}
private Uri GetProxyUri(HttpProxySettings proxySettings)
private static Uri GetProxyUri(HttpProxySettings proxySettings)
{
switch (proxySettings.Type)
{

View file

@ -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<string>();
var cleansed = CleanseLogMessage.Cleanse(text);

View file

@ -19,7 +19,7 @@ public void Initialize()
var sentryTarget = LogManager.Configuration.AllTargets.OfType<SentryTarget>().FirstOrDefault();
if (sentryTarget != null)
{
sentryTarget.UpdateScope(_osInfo);
SentryTarget.UpdateScope(_osInfo);
}
}
}

View file

@ -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 =>
{

View file

@ -132,7 +132,7 @@ private void ShouldHaveAddedDefaultFormat(IDirectDataMapper db)
}
}
private List<Profile147> QueryItems(IDirectDataMapper db)
private static List<Profile147> QueryItems(IDirectDataMapper db)
{
var test = db.Query("SELECT * FROM \"Profiles\"");

View file

@ -75,7 +75,7 @@ public void should_correctly_convert_multiple_formats()
convertedTags2.Should().BeEquivalentTo("E_NRXRQ_Director");
}
private List<CustomFormatTest149> QueryItems(IDirectDataMapper db)
private static List<CustomFormatTest149> QueryItems(IDirectDataMapper db)
{
var items = db.Query<CustomFormatTest149>("SELECT \"Name\", \"FormatTags\" FROM \"CustomFormats\"");

View file

@ -38,7 +38,7 @@ public void should_correctly_convert_format_tag(string original, string converte
convertedTags.First().Should().BeEquivalentTo(converted);
}
private List<regex_required_tagsFixture.CustomFormatTest149> QueryItems(IDirectDataMapper db)
private static List<regex_required_tagsFixture.CustomFormatTest149> QueryItems(IDirectDataMapper db)
{
var items = db.Query<regex_required_tagsFixture.CustomFormatTest149>("SELECT \"Name\", \"FormatTags\" FROM \"CustomFormats\"");

View file

@ -10,12 +10,12 @@ namespace NzbDrone.Core.Test.Datastore.Migration
[TestFixture]
public class add_webrip_qualitesFixture : MigrationTest<add_webrip_qualites>
{
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()} }} ] }}";
}

View file

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

View file

@ -22,12 +22,12 @@ public void MapTables()
Mocker.Resolve<DbFactory>();
}
private WhereBuilderPostgres Where(Expression<Func<Movie, bool>> filter)
private static WhereBuilderPostgres Where(Expression<Func<Movie, bool>> filter)
{
return new WhereBuilderPostgres(filter, true, 0);
}
private WhereBuilderPostgres WhereMeta(Expression<Func<MovieMetadata, bool>> filter)
private static WhereBuilderPostgres WhereMeta(Expression<Func<MovieMetadata, bool>> filter)
{
return new WhereBuilderPostgres(filter, true, 0);
}

View file

@ -22,12 +22,12 @@ public void MapTables()
Mocker.Resolve<DbFactory>();
}
private WhereBuilderSqlite Where(Expression<Func<Movie, bool>> filter)
private static WhereBuilderSqlite Where(Expression<Func<Movie, bool>> filter)
{
return new WhereBuilderSqlite(filter, true, 0);
}
private WhereBuilderSqlite WhereMeta(Expression<Func<MovieMetadata, bool>> filter)
private static WhereBuilderSqlite WhereMeta(Expression<Func<MovieMetadata, bool>> filter)
{
return new WhereBuilderSqlite(filter, true, 0);
}

View file

@ -31,7 +31,7 @@ public void SetUp()
.Returns<List<DownloadDecision>>(v => v);
}
private Movie GetMovie(int id)
private static Movie GetMovie(int id)
{
return Builder<Movie>.CreateNew()
.With(e => e.Id = id)

View file

@ -73,7 +73,7 @@ protected Dictionary<string, object> MapToDictionary(DataRow dataRow)
return item;
}
protected T MapToObject<T>(DataRow dataRow)
protected static T MapToObject<T>(DataRow dataRow)
where T : new()
{
var item = new T();

View file

@ -11,7 +11,7 @@ namespace NzbDrone.Core.Test.Http
[Platform(Exclude = "MacOsX")]
public class HttpProxySettingsProviderFixture : TestBase<HttpProxySettingsProvider>
{
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();
}
}
}

View file

@ -11,7 +11,7 @@ namespace NzbDrone.Core.Test.ImportList.CouchPotato
{
public class CouchPotatoTest : CoreTest<CouchPotatoParser>
{
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));

View file

@ -12,7 +12,7 @@ namespace NzbDrone.Core.Test.ImportList.Plex
[TestFixture]
public class PlexParserFixture : CoreTest<PlexParser>
{
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));

View file

@ -11,7 +11,7 @@ namespace NzbDrone.Core.Test.ImportList
{
public class RSSImportTest : CoreTest<RSSImportParser>
{
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));

View file

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

View file

@ -42,7 +42,7 @@ private void ValidateTorrentResult(IList<ReleaseInfo> reports, bool hasSize = fa
}
}
private void ValidateResult(IList<ReleaseInfo> reports, bool hasSize = false, bool hasInfoUrl = false)
private static void ValidateResult(IList<ReleaseInfo> reports, bool hasSize = false, bool hasInfoUrl = false)
{
reports.Should().NotBeEmpty();
reports.Should().OnlyContain(c => c.Title.IsNotNullOrWhiteSpace());

View file

@ -29,7 +29,7 @@ public List<ValidationFailure> TestPublic()
/// <summary>
/// Code to quickly debug unit tests
/// </summary>
private void SetupNLog()
private static void SetupNLog()
{
// Step 1. Create configuration object
var config = new LoggingConfiguration();

View file

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

View file

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

View file

@ -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)

View file

@ -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,

View file

@ -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)
{

View file

@ -477,7 +477,7 @@ private void SaveConfigFile(XDocument xDoc)
}
}
private string GenerateApiKey()
private static string GenerateApiKey()
{
return Guid.NewGuid().ToString().Replace("-", "");
}

View file

@ -433,7 +433,7 @@ public virtual PagingSpec<TModel> GetPaged(PagingSpec<TModel> pagingSpec)
return pagingSpec;
}
protected void AddFilters(SqlBuilder builder, PagingSpec<TModel> pagingSpec)
protected static void AddFilters(SqlBuilder builder, PagingSpec<TModel> pagingSpec)
{
var filters = pagingSpec.FilterExpressions;

View file

@ -77,7 +77,7 @@ public override List<IAutoTaggingSpecification> 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)
{

View file

@ -76,7 +76,7 @@ public override List<ICustomFormatSpecification> 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)
{

View file

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

View file

@ -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())
{

View file

@ -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())
{

View file

@ -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())
{

View file

@ -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())
{

View file

@ -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())
{

View file

@ -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())
{

View file

@ -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())
{

View file

@ -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

View file

@ -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

View file

@ -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())
{

View file

@ -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())
{

View file

@ -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())
{

View file

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

View file

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

View file

@ -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<DownloadClients156>($"SELECT \"Id\", \"Implementation\" FROM \"DownloadClients\" WHERE \"Enable\"");

View file

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

View file

@ -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<QualityRow>($"SELECT \"Id\", \"Quality\" from \"{table}\"");

View file

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

View file

@ -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())
{

View file

@ -63,7 +63,7 @@ private void FixMovies(IDbConnection conn, IDbTransaction tran)
}
}
private List<int> GetProfileIds(IDbConnection conn)
private static List<int> GetProfileIds(IDbConnection conn)
{
return conn.Query<QualityProfile180>("SELECT \"Id\" From \"Profiles\"").Select(p => p.Id).ToList();
}

View file

@ -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())
{

View file

@ -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<MovieEntity185>($"SELECT \"Id\", \"TmdbId\", \"Added\", \"LastInfoSync\", \"MovieFileId\" FROM \"Movies\"");

View file

@ -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())
{

View file

@ -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<string> MigrateLanguages(string mediaInfoLanguages)
private static List<string> MigrateLanguages(string mediaInfoLanguages)
{
var languages = new List<string>();
@ -788,12 +788,12 @@ private List<string> 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")
{

View file

@ -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;

View file

@ -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)
{

View file

@ -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)
{

View file

@ -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, TValue>(TSubject left, TSubject right, Func<TSubject, TValue> funcValue)
private static int CompareBy<TSubject, TValue>(TSubject left, TSubject right, Func<TSubject, TValue> funcValue)
where TValue : IComparable<TValue>
{
var leftValue = funcValue(left);
@ -58,7 +58,7 @@ private int CompareByReverse<TSubject, TValue>(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));

View file

@ -139,7 +139,7 @@ public bool QualityCutoffNotMet(QualityProfile profile, QualityModel currentQual
return false;
}
private bool CustomFormatCutoffNotMet(QualityProfile profile, List<CustomFormat> currentFormats)
private static bool CustomFormatCutoffNotMet(QualityProfile profile, List<CustomFormat> currentFormats)
{
var score = profile.CalculateCustomFormatScore(currentFormats);
var cutoff = profile.UpgradeAllowed ? profile.CutoffFormatScore : profile.MinFormatScore;

View file

@ -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)
{

View file

@ -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}";
}

View file

@ -294,7 +294,7 @@ private JsonRpcResponse<TResult> ExecuteRequest<TResult>(JsonRpcRequestBuilder r
}
}
private void VerifyResponse<TResult>(JsonRpcResponse<TResult> response)
private static void VerifyResponse<TResult>(JsonRpcResponse<TResult> 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)
{

View file

@ -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}";
}

View file

@ -215,7 +215,7 @@ protected override void Test(List<ValidationFailure> 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}";
}

View file

@ -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}";
}

View file

@ -35,7 +35,7 @@ public FloodProxy(IHttpClient httpClient, ICacheManager cacheManager, Logger log
_authCookieCache = cacheManager.GetCache<Dictionary<string, string>>(GetType(), "authCookies");
}
private string BuildUrl(FloodSettings settings)
private static string BuildUrl(FloodSettings settings)
{
return $"{(settings.UseSsl ? "https://" : "http://")}{settings.Host}:{settings.Port}/{settings.UrlBase}";
}

View file

@ -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)
{

View file

@ -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)
{

View file

@ -113,7 +113,7 @@ public List<NzbVortexFile> 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");

View file

@ -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;

View file

@ -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;

View file

@ -223,7 +223,7 @@ public Dictionary<string, QBittorrentLabel> GetLabels(QBittorrentSettings settin
return Json.Deserialize<Dictionary<string, QBittorrentLabel>>(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;

View file

@ -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<string> categories, string category)
private static bool ContainsCategory(IEnumerable<string> categories, string category)
{
if (categories == null || categories.Empty())
{
@ -535,7 +535,7 @@ private bool ContainsCategory(IEnumerable<string> 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;

View file

@ -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<SabnzbdJsonError>(response.Content, out var result))
{

View file

@ -142,7 +142,7 @@ public override IEnumerable<DownloadClientItem> GetItems()
return items;
}
protected bool HasReachedSeedLimit(TransmissionTorrent torrent, double? ratio, Lazy<TransmissionConfig> config)
protected static bool HasReachedSeedLimit(TransmissionTorrent torrent, double? ratio, Lazy<TransmissionConfig> config)
{
var isStopped = torrent.Status == TransmissionTorrentStatus.Stopped;
var isSeeding = torrent.Status == TransmissionTorrentStatus.Seeding;

View file

@ -242,7 +242,7 @@ private TransmissionResponse GetTorrentStatus(IEnumerable<string> 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);
}

View file

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

View file

@ -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/")

View file

@ -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;

View file

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

View file

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

View file

@ -158,13 +158,13 @@ internal List<DownloadDecision> GetQualifiedReports(IEnumerable<DownloadDecision
return decisions.Where(IsQualifiedReport).ToList();
}
internal bool IsQualifiedReport(DownloadDecision decision)
internal static bool IsQualifiedReport(DownloadDecision decision)
{
// Process both approved and temporarily rejected
return (decision.Approved || decision.TemporarilyRejected) && decision.RemoteMovie.Movie != null;
}
private bool IsMovieProcessed(List<DownloadDecision> decisions, DownloadDecision report)
private static bool IsMovieProcessed(List<DownloadDecision> decisions, DownloadDecision report)
{
var movieId = report.RemoteMovie.Movie.Id;

View file

@ -39,7 +39,7 @@ public virtual ImportExistingExtraFileFilterResult<TExtraFile> FilterAndClean(Mo
return Filter(movie, filesOnDisk, importedFiles, movieFiles);
}
private ImportExistingExtraFileFilterResult<TExtraFile> Filter(Movie movie, List<string> filesOnDisk, List<string> importedFiles, List<TExtraFile> movieFiles)
private static ImportExistingExtraFileFilterResult<TExtraFile> Filter(Movie movie, List<string> filesOnDisk, List<string> importedFiles, List<TExtraFile> 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)

View file

@ -100,7 +100,7 @@ public override List<ImageFileResult> MovieImages(Movie movie)
return new List<ImageFileResult>();
}
private IEnumerable<ImageFileResult> ProcessMovieImages(Movie movie)
private static IEnumerable<ImageFileResult> ProcessMovieImages(Movie movie)
{
return new List<ImageFileResult>();
}

View file

@ -149,12 +149,12 @@ public override List<ImageFileResult> MovieImages(Movie movie)
return new List<ImageFileResult> { 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");
}

View file

@ -148,12 +148,12 @@ public override List<ImageFileResult> 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");
}

View file

@ -202,7 +202,7 @@ public override IEnumerable<ExtraFile> ImportFiles(LocalMovie localMovie, MovieF
return Enumerable.Empty<ExtraFile>();
}
private List<MetadataFile> GetMetadataFilesForConsumer(IMetadata consumer, List<MetadataFile> movieMetadata)
private static List<MetadataFile> GetMetadataFilesForConsumer(IMetadata consumer, List<MetadataFile> movieMetadata)
{
return movieMetadata.Where(c => c.Consumer == consumer.GetType().Name).ToList();
}

View file

@ -235,7 +235,7 @@ public override IEnumerable<ExtraFile> ImportFiles(LocalMovie localMovie, MovieF
return importedFiles;
}
private string GetSuffix(Language language, int copy, List<string> languageTags, bool multipleCopies = false, string title = null)
private static string GetSuffix(Language language, int copy, List<string> languageTags, bool multipleCopies = false, string title = null)
{
var suffixBuilder = new StringBuilder();

View file

@ -87,7 +87,7 @@ public override HealthCheck Check()
return new HealthCheck(GetType());
}
private string FormatRootFolder(string rootFolderPath, List<ImportListDefinition> importLists)
private static string FormatRootFolder(string rootFolderPath, List<ImportListDefinition> importLists)
{
return $"{rootFolderPath} ({string.Join(", ", importLists.Select(l => l.Name))})";
}

View file

@ -82,7 +82,7 @@ public override HealthCheck Check()
return new HealthCheck(GetType());
}
private string FormatRootFolder(string rootFolderPath, List<MovieCollection> collections)
private static string FormatRootFolder(string rootFolderPath, List<MovieCollection> collections)
{
return $"{rootFolderPath} ({string.Join(", ", collections.Select(c => c.Title))})";
}

View file

@ -133,7 +133,7 @@ protected override IEnumerable<MovieHistory> PagedQuery(SqlBuilder builder) =>
return hist;
});
private string BuildLanguageWhereClause(int[] languages)
private static string BuildLanguageWhereClause(int[] languages)
{
var clauses = new List<string>();
@ -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<string>();

View file

@ -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<List<int>>(

Some files were not shown because too many files have changed in this diff Show more