summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Helpers
diff options
context:
space:
mode:
authorsr55 <[email protected]>2019-04-20 22:51:01 +0100
committersr55 <[email protected]>2019-04-20 22:51:42 +0100
commit8ae989f31db31c43c069efc2c1fd8b1c2b65ef8f (patch)
tree269238f808d78c4b83d3a203f27839c3619230e5 /win/CS/HandBrakeWPF/Helpers
parent4e0cf3ef3d5decfe30f26306bbc969c00b3c0861 (diff)
WinGui: New option to control the file overwrite default behaviour. Overwrite or Ask.
Diffstat (limited to 'win/CS/HandBrakeWPF/Helpers')
-rw-r--r--win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs24
1 files changed, 15 insertions, 9 deletions
diff --git a/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs b/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs
index b1333dcaa..4a1e96b50 100644
--- a/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs
+++ b/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs
@@ -12,12 +12,14 @@ namespace HandBrakeWPF.Helpers
using System;
using System.IO;
using System.Linq;
+ using System.Runtime.CompilerServices;
using Caliburn.Micro;
using HandBrake.Interop.Interop.Model.Encoding;
using HandBrakeWPF.Extensions;
+ using HandBrakeWPF.Model.Options;
using HandBrakeWPF.Services.Encode.Model;
using HandBrakeWPF.Services.Interfaces;
using HandBrakeWPF.Services.Presets.Model;
@@ -227,17 +229,21 @@ namespace HandBrakeWPF.Helpers
}
// Append out_ to files that already exist or is the source file
- if (autoNamePath?.ToLower() == task.Source?.ToLower())
- {
- autoNamePath = Path.Combine(Path.GetDirectoryName(task.Source), "output_" + destinationFilename);
-
- int counter = 1;
- while (autoNamePath == task.Source)
+ //FileOverwriteBehaviour behaviour = (FileOverwriteBehaviour)userSettingService.GetUserSetting<int>(UserSettingConstants.FileOverwriteBehaviour, typeof(int));
+ //if (behaviour == FileOverwriteBehaviour.Autoname)
+ //{
+ if (autoNamePath?.ToLower() == task.Source?.ToLower())
{
- autoNamePath = Path.Combine(Path.GetDirectoryName(task.Source), string.Format("output{0}_", counter) + destinationFilename);
- counter = counter + 1;
+ autoNamePath = Path.Combine(Path.GetDirectoryName(task.Source), "output_" + destinationFilename);
+
+ int counter = 1;
+ while (autoNamePath == task.Source)
+ {
+ autoNamePath = Path.Combine(Path.GetDirectoryName(task.Source), string.Format("output{0}_", counter) + destinationFilename);
+ counter = counter + 1;
+ }
}
- }
+ //}
}
return autoNamePath;