Add third parameter for ID of parent channel

This commit is contained in:
Jacob P. 2024-01-24 01:34:41 +01:00
parent 7bfb1c6fcc
commit 0792ca7691
No known key found for this signature in database
GPG key ID: 4A755417EB440EA0

View file

@ -209,15 +209,16 @@ public partial class ExportRequest
// We are looking for any structure in the path which contains either %y or %z. If the channel is a thread, we can resolve the placeholders, otherwise, that whole structure needs to be removed.
string formattedPath = Regex.Replace(
preFormattedPath,
@"\\[^\\]*%[yz][^\\]*\\",
@"\\[^\\]*%[xyz][^\\]*\\",
m =>
channel.IsThread
? Regex.Replace(
m.Value,
"%[yz]",
"%[xyz]",
n =>
n.Value switch
{
"%x" => channel.Parent?.Id.ToString() ?? "",
"%y"
=> channel
.Parent?.Position