diff options
author | sr55 <[email protected]> | 2016-01-17 17:29:26 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2016-01-17 17:43:31 +0000 |
commit | 69f4df1aad19226b0d980b5076810d873bca7498 (patch) | |
tree | 9917f8287c5f0f24624118a8f1ec92c8ccc815a5 | |
parent | 8620ba14fb4b1580843f28d6aeeb5a3d2b1af1cd (diff) |
WinGui: Fix Preset json file import.
-rw-r--r-- | win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs | 4 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Services/Presets/PresetService.cs | 9 |
2 files changed, 7 insertions, 6 deletions
diff --git a/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs b/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs index b87119205..2f6afe626 100644 --- a/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs +++ b/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs @@ -75,13 +75,14 @@ namespace HandBrakeWPF.Services.Presets.Factories preset.Task.MaxHeight = importedPreset.PictureHeight.HasValue && importedPreset.PictureHeight.Value > 0 ? importedPreset.PictureHeight.Value : (int?)null;
preset.Task.Cropping = new Cropping(importedPreset.PictureTopCrop, importedPreset.PictureBottomCrop, importedPreset.PictureLeftCrop, importedPreset.PictureRightCrop);
preset.Task.HasCropping = !importedPreset.PictureAutoCrop;
-
preset.Task.Modulus = importedPreset.PictureModulus;
preset.Task.KeepDisplayAspect = importedPreset.PictureKeepRatio;
+
switch (importedPreset.PicturePAR)
{
case "custom":
preset.Task.Anamorphic = Anamorphic.Custom;
+ preset.Task.DisplayWidth = importedPreset.PictureDARWidth;
break;
case "loose":
preset.Task.Anamorphic = Anamorphic.Loose;
@@ -407,7 +408,6 @@ namespace HandBrakeWPF.Services.Presets.Factories // public List<object> ChildrenArray { get; set; }
// public bool Folder { get; set; }
// public bool FolderOpen { get; set; }
- // public int PictureDARWidth { get; set; }
// public int Type { get; set; }
return preset;
diff --git a/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs b/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs index 6e6935f00..9b470cb06 100644 --- a/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs +++ b/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs @@ -151,11 +151,12 @@ namespace HandBrakeWPF.Services.Presets }
// HBPreset Handling
- IList<HBPreset> hbPresets = container.PresetList as IList<HBPreset>;
- if (hbPresets != null)
+ if (container.PresetList != null)
{
- foreach (var hbPreset in hbPresets)
+ foreach (var objectPreset in container.PresetList)
{
+ HBPreset hbPreset = JsonConvert.DeserializeObject<HBPreset>(objectPreset.ToString());
+
Preset preset = null;
try
{
@@ -180,7 +181,7 @@ namespace HandBrakeWPF.Services.Presets return;
}
- if (this.CheckIfPresetExists(preset.Name))
+ if (this.CheckIfPresetExists(preset.Name))
{
if (!this.CanUpdatePreset(preset.Name))
{
|