summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorsr55 <[email protected]>2017-09-20 19:25:37 +0100
committersr55 <[email protected]>2017-09-20 19:25:37 +0100
commit262097f63114fc167f545e32ac230f39b64bdaf7 (patch)
tree8b524f9636731ab663f9c07d28ace3bf5721d022 /win
parentb37f8bdea2ca939480b865edb9db58404c0d2184 (diff)
WinGui: Tidy up some warnings that you get when you import WinGui presets into the CLI. #906
Diffstat (limited to 'win')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/HandBrakePresetService.cs2
-rw-r--r--win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs2
2 files changed, 2 insertions, 2 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakePresetService.cs b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakePresetService.cs
index adc9bcbd6..ae3387006 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakePresetService.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakePresetService.cs
@@ -91,7 +91,7 @@ namespace HandBrake.ApplicationServices.Interop
/// </param>
public static void ExportPreset(string filename, PresetTransportContainer container)
{
- string preset = JsonConvert.SerializeObject(container, Formatting.Indented);
+ string preset = JsonConvert.SerializeObject(container, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
using (StreamWriter writer = new StreamWriter(filename))
{
writer.Write(preset);
diff --git a/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs b/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs
index b3d138efd..4acbc4c63 100644
--- a/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs
+++ b/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs
@@ -657,7 +657,7 @@ namespace HandBrakeWPF.Services.Presets.Factories
// Video
preset.VideoEncoder = EnumHelper<VideoEncoder>.GetShortName(export.Task.VideoEncoder);
- preset.VideoFramerate = export.Task.Framerate.ToString();
+ preset.VideoFramerate = export.Task.Framerate.HasValue ? export.Task.Framerate.ToString() : null;
preset.VideoFramerateMode = EnumHelper<FramerateMode>.GetShortName(export.Task.FramerateMode);
preset.VideoGrayScale = export.Task.Grayscale;
preset.VideoLevel = export.Task.VideoLevel != null ? export.Task.VideoLevel.ShortName : null;