From 7d4f1bb45ecba4ce2092bedf915dcd5761888d17 Mon Sep 17 00:00:00 2001 From: sr55 Date: Thu, 25 Apr 2019 15:49:24 +0100 Subject: [PATCH] WinGui: Fix Autoname directory selection --- win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs b/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs index cf21aae0a..bcd249798 100644 --- a/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs +++ b/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs @@ -231,8 +231,6 @@ namespace HandBrakeWPF.Helpers } autoNamePath = CheckAndHandleFilenameCollisions(autoNamePath, destinationFilename, task, userSettingService); - - } return autoNamePath; @@ -280,14 +278,14 @@ namespace HandBrakeWPF.Helpers { if (autoNamePath?.ToLower() == task.Source?.ToLower()) { - autoNamePath = Path.Combine(Path.GetDirectoryName(task.Source), prefix + filenameWithoutExt + postfix + extension); + 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(task.Source), prefix + filenameWithoutExt + postfix + appendedNumber + extension); + autoNamePath = Path.Combine(Path.GetDirectoryName(autoNamePath), prefix + filenameWithoutExt + postfix + appendedNumber + extension); } } } @@ -298,7 +296,7 @@ namespace HandBrakeWPF.Helpers { counter = counter + 1; string appendedNumber = string.Format("({0})", counter); - autoNamePath = Path.Combine(Path.GetDirectoryName(task.Source), filenameWithoutExt + appendedNumber + extension); + autoNamePath = Path.Combine(Path.GetDirectoryName(autoNamePath), filenameWithoutExt + appendedNumber + extension); } } -- 2.40.0