]> granicus.if.org Git - handbrake/commitdiff
WinGui: Fix Autoname directory selection
authorsr55 <sr55.hb@outlook.com>
Thu, 25 Apr 2019 14:49:24 +0000 (15:49 +0100)
committersr55 <sr55.hb@outlook.com>
Thu, 25 Apr 2019 14:49:24 +0000 (15:49 +0100)
win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs

index cf21aae0ab0e9864b3c9ac5cf88cbaa324578a98..bcd249798357fe10f74e56988e75704fefe0ab57 100644 (file)
@@ -231,8 +231,6 @@ namespace HandBrakeWPF.Helpers
                 }\r
 \r
                 autoNamePath = CheckAndHandleFilenameCollisions(autoNamePath, destinationFilename, task, userSettingService);\r
-\r
-\r
             }\r
 \r
             return autoNamePath;\r
@@ -280,14 +278,14 @@ namespace HandBrakeWPF.Helpers
             {\r
                 if (autoNamePath?.ToLower() == task.Source?.ToLower())\r
                 {\r
-                    autoNamePath = Path.Combine(Path.GetDirectoryName(task.Source), prefix + filenameWithoutExt + postfix + extension);\r
+                    autoNamePath = Path.Combine(Path.GetDirectoryName(autoNamePath), prefix + filenameWithoutExt + postfix + extension);\r
 \r
                     int counter = 0;\r
                     while (File.Exists(autoNamePath))\r
                     {\r
                         counter = counter + 1;\r
                         string appendedNumber = string.Format("({0})", counter);\r
-                        autoNamePath = Path.Combine(Path.GetDirectoryName(task.Source), prefix + filenameWithoutExt + postfix + appendedNumber + extension);\r
+                        autoNamePath = Path.Combine(Path.GetDirectoryName(autoNamePath), prefix + filenameWithoutExt + postfix + appendedNumber + extension);\r
                     }\r
                 }\r
             }\r
@@ -298,7 +296,7 @@ namespace HandBrakeWPF.Helpers
                 {\r
                     counter = counter + 1;\r
                     string appendedNumber = string.Format("({0})", counter);\r
-                    autoNamePath = Path.Combine(Path.GetDirectoryName(task.Source),  filenameWithoutExt + appendedNumber + extension);\r
+                    autoNamePath = Path.Combine(Path.GetDirectoryName(autoNamePath),  filenameWithoutExt + appendedNumber + extension);\r
                 }\r
             }\r
 \r