Fix incorrect replace order

This commit is contained in:
Tyrrrz 2023-01-03 10:44:31 +02:00
parent 67b31c5f68
commit 506bc0176b

View file

@ -91,11 +91,10 @@ public partial record ExportRequest
Snowflake? before = null) Snowflake? before = null)
{ {
// Format path // Format path
var actualOutputPath = PathEx.EscapeFileName( var actualOutputPath = Regex.Replace(
Regex.Replace(
outputPath, outputPath,
"%.", "%.",
m => m.Value switch m => PathEx.EscapeFileName(m.Value switch
{ {
"%g" => guild.Id.ToString(), "%g" => guild.Id.ToString(),
"%G" => guild.Name, "%G" => guild.Name,
@ -110,8 +109,7 @@ public partial record ExportRequest
"%d" => DateTimeOffset.Now.ToString("yyyy-MM-dd"), "%d" => DateTimeOffset.Now.ToString("yyyy-MM-dd"),
"%%" => "%", "%%" => "%",
_ => m.Value _ => m.Value
} })
)
); );
// Output is a directory // Output is a directory