Skip to content

Commit

Permalink
Fix Fix custom parameters not working when more than one custom param…
Browse files Browse the repository at this point in the history
…eter is used
  • Loading branch information
ScrubN committed Nov 26, 2023
1 parent 95e9620 commit 2eda696
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions TwitchDownloaderCore/Tools/FilenameService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,25 @@ public static string GetFilename(string template, string title, string id, DateT

if (template.Contains("{date_custom="))
{
var dateRegex = new Regex("{date_custom=\"(.*)\"}");
var dateRegex = new Regex("{date_custom=\"(.*?)\"}");
ReplaceCustomWithFormattable(stringBuilder, dateRegex, date);
}

if (template.Contains("{crop_start_custom="))
{
var cropStartRegex = new Regex("{crop_start_custom=\"(.*)\"}");
var cropStartRegex = new Regex("{crop_start_custom=\"(.*?)\"}");
ReplaceCustomWithFormattable(stringBuilder, cropStartRegex, cropStart);
}

if (template.Contains("{crop_end_custom="))
{
var cropEndRegex = new Regex("{crop_end_custom=\"(.*)\"}");
var cropEndRegex = new Regex("{crop_end_custom=\"(.*?)\"}");
ReplaceCustomWithFormattable(stringBuilder, cropEndRegex, cropEnd);
}

if (template.Contains("{length_custom="))
{
var lengthRegex = new Regex("{length_custom=\"(.*)\"}");
var lengthRegex = new Regex("{length_custom=\"(.*?)\"}");
ReplaceCustomWithFormattable(stringBuilder, lengthRegex, videoLength);
}

Expand Down

0 comments on commit 2eda696

Please sign in to comment.