summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2020-09-06 11:17:02 +0100
committersr55 <[email protected]>2020-09-06 11:17:02 +0100
commit02eeebd9229340d90416fdb3faccf4a512a2079c (patch)
treef690644e0e89355f1710070d84641f426809d5c5 /win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs
parent50535c33e0a4734a1f15b26e87db101854e2b96f (diff)
WinGui: Fix a bug with pre/postfix in autoname functonality
Diffstat (limited to 'win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs')
-rw-r--r--win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs17
1 files changed, 7 insertions, 10 deletions
diff --git a/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs b/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs
index 0d10c71f2..6483e0fa5 100644
--- a/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs
+++ b/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs
@@ -266,17 +266,14 @@ namespace HandBrakeWPF.Helpers
if (behaviour != AutonameFileCollisionBehaviour.AppendNumber)
{
- if (autoNamePath?.ToLower() == task.Source?.ToLower())
+ autoNamePath = Path.Combine(Path.GetDirectoryName(autoNamePath), prefix + filenameWithoutExt + postfix + extension);
+
+ int counter = 0;
+ while (File.Exists(autoNamePath))
{
- autoNamePath = Path.Combine(Path.GetDirectoryName(autoNamePath), prefix + filenameWithoutExt + postfix + extension);
-
- int counter = 0;
- while (File.Exists(autoNamePath))
- {
- counter = counter + 1;
- string appendedNumber = string.Format("({0})", counter);
- autoNamePath = Path.Combine(Path.GetDirectoryName(autoNamePath), prefix + filenameWithoutExt + postfix + appendedNumber + extension);
- }
+ counter = counter + 1;
+ string appendedNumber = string.Format("({0})", counter);
+ autoNamePath = Path.Combine(Path.GetDirectoryName(autoNamePath), prefix + filenameWithoutExt + postfix + appendedNumber + extension);
}
}
else