diff --git a/src/Recyclarr.Cli/Pipelines/QualityProfile/UpdatedQualityProfile.cs b/src/Recyclarr.Cli/Pipelines/QualityProfile/UpdatedQualityProfile.cs
index c54f5f1a..0bc2a24f 100644
--- a/src/Recyclarr.Cli/Pipelines/QualityProfile/UpdatedQualityProfile.cs
+++ b/src/Recyclarr.Cli/Pipelines/QualityProfile/UpdatedQualityProfile.cs
@@ -37,7 +37,7 @@ public record UpdatedQualityProfile
// The `qualityprofile` API will still validate `cutoff` even when `upgradeAllowed` is set to `false`.
// Because of this, we cannot set cutoff to null. We pick the first available if the user didn't specify one.
- var cutoff = config.UpgradeAllowed is true
+ var cutoff = config.UpgradeAllowed
? UpdatedQualities.Items.FindCutoff(config.UpgradeUntilQuality)
: UpdatedQualities.Items.First().Id;
diff --git a/src/Recyclarr.Gui/Pages/_Host.cshtml b/src/Recyclarr.Gui/Pages/_Host.cshtml
index 44a361fe..209a6538 100644
--- a/src/Recyclarr.Gui/Pages/_Host.cshtml
+++ b/src/Recyclarr.Gui/Pages/_Host.cshtml
@@ -1,9 +1,8 @@
@page "/"
-@using Microsoft.AspNetCore.Mvc.TagHelpers
@namespace Recyclarr.Gui.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{
Layout = "_Layout";
}
-
\ No newline at end of file
+
diff --git a/src/Recyclarr.Gui/Pages/_Layout.cshtml b/src/Recyclarr.Gui/Pages/_Layout.cshtml
index 5e10cea1..e1377bc7 100644
--- a/src/Recyclarr.Gui/Pages/_Layout.cshtml
+++ b/src/Recyclarr.Gui/Pages/_Layout.cshtml
@@ -1,5 +1,4 @@
@using Microsoft.AspNetCore.Components.Web
-@using Microsoft.AspNetCore.Mvc.TagHelpers
@namespace Recyclarr.Gui.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
diff --git a/src/Recyclarr.TrashLib/Http/FlurlExtensions.cs b/src/Recyclarr.TrashLib/Http/FlurlExtensions.cs
index 53759fcf..c7ca24f9 100644
--- a/src/Recyclarr.TrashLib/Http/FlurlExtensions.cs
+++ b/src/Recyclarr.TrashLib/Http/FlurlExtensions.cs
@@ -3,23 +3,26 @@ using Flurl.Http;
namespace Recyclarr.TrashLib.Http;
-public static class FlurlExtensions
+public static partial class FlurlExtensions
{
public static string SanitizedExceptionMessage(this FlurlHttpException exception)
{
// Replace full URLs
- const string urlExpression =
- @"https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}(\:[0-9]+)?\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)";
- var result = Regex.Replace(exception.Message, urlExpression, Sanitize);
+ var result = UrlRegex().Replace(exception.Message, Sanitize);
// There are sometimes parenthetical parts of the message that contain the host but are not
// detected as true URLs. Just strip those out completely.
- const string hostExpression = @"\([-a-zA-Z0-9@:%._+~#=]{1,256}(?:\:[0-9]+)\)";
- return Regex.Replace(result, hostExpression, "");
+ return HostRegex().Replace(result, "");
}
private static string Sanitize(Match match)
{
- return FlurlLogging.SanitizeUrl(match.Value).ToString();
+ return FlurlLogging.SanitizeUrl(match.Value).ToString() ?? match.Value;
}
+
+ [GeneratedRegex(@"\([-a-zA-Z0-9@:%._+~#=]{1,256}(?::[0-9]+)?\)")]
+ private static partial Regex HostRegex();
+
+ [GeneratedRegex(@"https?://(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}(:[0-9]+)?\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)")]
+ private static partial Regex UrlRegex();
}