summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Services
diff options
context:
space:
mode:
authorsr55 <[email protected]>2021-02-06 20:37:10 +0000
committersr55 <[email protected]>2021-02-06 20:37:10 +0000
commit8843a96cc365af7c5466d503eb016e6c0d3637c9 (patch)
tree96f9386940ab17bc8e364d5fb8db91190cf0c577 /win/CS/HandBrakeWPF/Services
parentaa71590c27fed3e0aa1f14c9c886e299cb1a15f1 (diff)
WinGui: Add code to prevent double default presets. Fixes #3386
Diffstat (limited to 'win/CS/HandBrakeWPF/Services')
-rw-r--r--win/CS/HandBrakeWPF/Services/Presets/PresetService.cs7
1 files changed, 7 insertions, 0 deletions
diff --git a/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs b/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs
index 8d19c3282..2d280aad3 100644
--- a/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs
+++ b/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs
@@ -423,6 +423,8 @@ namespace HandBrakeWPF.Services.Presets
// Clear the current built in Presets and now parse the temporary Presets file.
this.ClearBuiltIn();
+ bool hasUserDefault = this.flatPresetDict.Values.FirstOrDefault(f => f.IsDefault) != null;
+
IList<HBPresetCategory> presetCategories = HandBrakePresetService.GetBuiltInPresets();
foreach (var category in presetCategories)
@@ -435,6 +437,11 @@ namespace HandBrakeWPF.Services.Presets
preset.Task.AllowedPassthruOptions = new AllowedPassthru(true); // We don't want to override the built-in preset
preset.IsPresetDisabled = this.IsPresetDisabled(preset) || hbpreset.PresetDisabled;
+ if (hbpreset.Default && hasUserDefault)
+ {
+ preset.IsDefault = false;
+ }
+
this.Add(preset, true);
}
}