From 64658a0bd0a7721f076fd0fe3abd471c823bd8d1 Mon Sep 17 00:00:00 2001 From: crobibero Date: Fri, 14 Aug 2020 08:23:23 -0600 Subject: [PATCH 1/2] Return int64 in json as number --- MediaBrowser.Common/Json/Converters/JsonInt64Converter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MediaBrowser.Common/Json/Converters/JsonInt64Converter.cs b/MediaBrowser.Common/Json/Converters/JsonInt64Converter.cs index d18fd95d5..7a720a4c9 100644 --- a/MediaBrowser.Common/Json/Converters/JsonInt64Converter.cs +++ b/MediaBrowser.Common/Json/Converters/JsonInt64Converter.cs @@ -50,7 +50,7 @@ namespace MediaBrowser.Common.Json.Converters /// Options. public override void Write(Utf8JsonWriter writer, long value, JsonSerializerOptions options) { - writer.WriteStringValue(value.ToString(NumberFormatInfo.InvariantInfo)); + writer.WriteNumberValue(value); } } } From 64ace58ef5352fdf9659f9246410be0b02d7c349 Mon Sep 17 00:00:00 2001 From: crobibero Date: Fri, 14 Aug 2020 08:34:32 -0600 Subject: [PATCH 2/2] fix docs --- MediaBrowser.Common/Json/Converters/JsonInt64Converter.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MediaBrowser.Common/Json/Converters/JsonInt64Converter.cs b/MediaBrowser.Common/Json/Converters/JsonInt64Converter.cs index 7a720a4c9..427f1fa7e 100644 --- a/MediaBrowser.Common/Json/Converters/JsonInt64Converter.cs +++ b/MediaBrowser.Common/Json/Converters/JsonInt64Converter.cs @@ -8,7 +8,7 @@ using System.Text.Json.Serialization; namespace MediaBrowser.Common.Json.Converters { /// - /// Long to String JSON converter. + /// Parse JSON string as long. /// Javascript does not support 64-bit integers. /// public class JsonInt64Converter : JsonConverter @@ -43,7 +43,7 @@ namespace MediaBrowser.Common.Json.Converters } /// - /// Write long to JSON string. + /// Write long to JSON long. /// /// . /// Value to write.