1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-22 07:52:34 +00:00

Trim multiple occurrences of ending separators in filename

This commit is contained in:
Bogdan 2024-10-10 15:26:00 +03:00
parent f90b43b3e1
commit 9928d711a3

View file

@ -45,7 +45,7 @@ public class FileNameBuilder : IBuildFileNames
RegexOptions.Compiled | RegexOptions.IgnoreCase);
private static readonly Regex FileNameCleanupRegex = new Regex(@"([- ._])(\1)+", RegexOptions.Compiled);
private static readonly Regex TrimSeparatorsRegex = new Regex(@"[- ._]$", RegexOptions.Compiled);
private static readonly Regex TrimSeparatorsRegex = new Regex(@"[- ._]+$", RegexOptions.Compiled);
private static readonly Regex ScenifyRemoveChars = new Regex(@"(?<=\s)(,|<|>|\/|\\|;|:|'|""|\||`||~|!|\?|@|$|%|^|\*|-|_|=){1}(?=\s)|('|`||:|\?|,)(?=(?:(?:s|m|t|ve|ll|d|re)\s)|\s|$)|(\(|\)|\[|\]|\{|\})", RegexOptions.Compiled | RegexOptions.IgnoreCase);
private static readonly Regex ScenifyReplaceChars = new Regex(@"[\/]", RegexOptions.Compiled | RegexOptions.IgnoreCase);