Apply suggestions, fix warning

This commit is contained in:
crobibero 2020-04-23 21:41:10 -06:00
parent fe632146dc
commit 0765ef8bda

View File

@ -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();
} }
} }