diff --git a/src/Recyclarr.Cli/Cache/ServiceCache.cs b/src/Recyclarr.Cli/Cache/ServiceCache.cs index 299b44ee..8c213fad 100644 --- a/src/Recyclarr.Cli/Cache/ServiceCache.cs +++ b/src/Recyclarr.Cli/Cache/ServiceCache.cs @@ -94,6 +94,6 @@ public partial class ServiceCache : IServiceCache return _storagePath.CalculatePath(config, objectName); } - [GeneratedRegex("^[\\w-]+$", RegexOptions.None, 1000)] + [GeneratedRegex(@"^[\w-]+$", RegexOptions.None, 1000)] private static partial Regex AllowedObjectNameCharactersRegex(); } diff --git a/src/Recyclarr.Cli/Console/Settings/ISyncSettings.cs b/src/Recyclarr.Cli/Console/Settings/ISyncSettings.cs index fc37a82f..c2fbe434 100644 --- a/src/Recyclarr.Cli/Console/Settings/ISyncSettings.cs +++ b/src/Recyclarr.Cli/Console/Settings/ISyncSettings.cs @@ -5,6 +5,7 @@ namespace Recyclarr.Cli.Console.Settings; public interface ISyncSettings { SupportedServices? Service { get; } + // ReSharper disable once ReturnTypeCanBeEnumerable.Global IReadOnlyCollection Configs { get; } bool Preview { get; } IReadOnlyCollection? Instances { get; } diff --git a/src/Recyclarr.Cli/Logging/LoggerFactory.cs b/src/Recyclarr.Cli/Logging/LoggerFactory.cs index 9108657e..7c38d6ad 100644 --- a/src/Recyclarr.Cli/Logging/LoggerFactory.cs +++ b/src/Recyclarr.Cli/Logging/LoggerFactory.cs @@ -48,11 +48,6 @@ public class LoggerFactory var logFilePrefix = $"recyclarr_{DateTime.Now:yyyy-MM-dd_HH-mm-ss}"; var logDir = _paths.LogDirectory; - string LogFilePath(string type) - { - return logDir.File($"{logFilePrefix}.{type}.log").FullName; - } - return new LoggerConfiguration() .MinimumLevel.Is(LogEventLevel.Verbose) .Enrich.With() @@ -65,5 +60,10 @@ public class LoggerFactory .WriteTo.File(GetFileTemplate(), LogFilePath("verbose"))) .Enrich.FromLogContext() .CreateLogger(); + + string LogFilePath(string type) + { + return logDir.File($"{logFilePrefix}.{type}.log").FullName; + } } } diff --git a/src/Recyclarr.Cli/Pipelines/CustomFormat/Guide/CustomFormatCategoryParser.cs b/src/Recyclarr.Cli/Pipelines/CustomFormat/Guide/CustomFormatCategoryParser.cs index 81a86422..a91e3ea7 100644 --- a/src/Recyclarr.Cli/Pipelines/CustomFormat/Guide/CustomFormatCategoryParser.cs +++ b/src/Recyclarr.Cli/Pipelines/CustomFormat/Guide/CustomFormatCategoryParser.cs @@ -68,14 +68,15 @@ public partial class CustomFormatCategoryParser : ICustomFormatCategoryParser return tableRows // Filter out the `|---|---|---|` part of the table between the heading & data rows. - .Where(x => !Regex.IsMatch(x[0], @"^-+$", RegexOptions.None, TimeSpan.FromMilliseconds(1000))); + .Where(x => !Regex.IsMatch(x[0], "^-+$", RegexOptions.None, TimeSpan.FromMilliseconds(1000))); } private static List GetTableRow(string line) { var fields = new List(); - var match = TableRegex().Match(line); + + // ReSharper disable once InvertIf if (match.Success) { var tableRow = match.Groups[1].Value; @@ -85,9 +86,9 @@ public partial class CustomFormatCategoryParser : ICustomFormatCategoryParser return fields; } - [GeneratedRegex("^\\s*\\|(.*)\\|\\s*$", RegexOptions.None, 1000)] + [GeneratedRegex(@"^\s*\|(.*)\|\s*$", RegexOptions.None, 1000)] private static partial Regex TableRegex(); - [GeneratedRegex("^\\[(.+?)\\]\\(#(.+?)\\)$", RegexOptions.None, 1000)] + [GeneratedRegex(@"^\[(.+?)\]\(#(.+?)\)$", RegexOptions.None, 1000)] private static partial Regex LinkRegex(); }