diff options
author | sr55 <[email protected]> | 2021-02-06 20:37:10 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2021-02-06 20:37:10 +0000 |
commit | 8843a96cc365af7c5466d503eb016e6c0d3637c9 (patch) | |
tree | 96f9386940ab17bc8e364d5fb8db91190cf0c577 /win/CS/HandBrakeWPF/Services/Presets/PresetService.cs | |
parent | aa71590c27fed3e0aa1f14c9c886e299cb1a15f1 (diff) |
WinGui: Add code to prevent double default presets. Fixes #3386
Diffstat (limited to 'win/CS/HandBrakeWPF/Services/Presets/PresetService.cs')
-rw-r--r-- | win/CS/HandBrakeWPF/Services/Presets/PresetService.cs | 7 |
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);
}
}
|