Apply suggestions, fix warning

pull/2932/head
crobibero 5 years ago
parent fe632146dc
commit 0765ef8bda

@ -7,11 +7,6 @@ namespace Jellyfin.Server.Models
/// </summary> /// </summary>
public static class JsonOptions public static class JsonOptions
{ {
/// <summary>
/// Base Json Serializer Options.
/// </summary>
private static readonly JsonSerializerOptions _jsonOptions = new JsonSerializerOptions();
/// <summary> /// <summary>
/// Gets CamelCase json options. /// Gets CamelCase json options.
/// </summary> /// </summary>
@ -19,7 +14,7 @@ namespace Jellyfin.Server.Models
{ {
get get
{ {
var options = _jsonOptions; var options = DefaultJsonOptions;
options.PropertyNamingPolicy = JsonNamingPolicy.CamelCase; options.PropertyNamingPolicy = JsonNamingPolicy.CamelCase;
return options; return options;
} }
@ -32,10 +27,15 @@ namespace Jellyfin.Server.Models
{ {
get get
{ {
var options = _jsonOptions; var options = DefaultJsonOptions;
options.PropertyNamingPolicy = null; options.PropertyNamingPolicy = null;
return options; return options;
} }
} }
/// <summary>
/// Gets base Json Serializer Options.
/// </summary>
private static JsonSerializerOptions DefaultJsonOptions => new JsonSerializerOptions();
} }
} }

Loading…
Cancel
Save