mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-13 05:42:16 +01:00
bump System.Text.Json
This commit is contained in:
@@ -14,6 +14,11 @@ namespace MediaBrowser.Common.Json.Converters
|
||||
/// <inheritdoc />
|
||||
public override int? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
||||
{
|
||||
if (reader.TokenType == JsonTokenType.Null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (reader.TokenType == JsonTokenType.String)
|
||||
{
|
||||
ReadOnlySpan<byte> span = reader.HasValueSequence ? reader.ValueSequence.ToArray() : reader.ValueSpan;
|
||||
|
||||
@@ -21,6 +21,11 @@ namespace MediaBrowser.Common.Json.Converters
|
||||
/// <returns>Parsed value.</returns>
|
||||
public override long? Read(ref Utf8JsonReader reader, Type type, JsonSerializerOptions options)
|
||||
{
|
||||
if (reader.TokenType == JsonTokenType.Null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (reader.TokenType == JsonTokenType.String)
|
||||
{
|
||||
// try to parse number directly from bytes
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace MediaBrowser.Common.Json
|
||||
{
|
||||
ReadCommentHandling = JsonCommentHandling.Disallow,
|
||||
WriteIndented = false,
|
||||
IgnoreNullValues = true
|
||||
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingDefault
|
||||
};
|
||||
|
||||
options.Converters.Add(new JsonGuidConverter());
|
||||
|
||||
Reference in New Issue
Block a user