From b9dbdc7e542af6e84de75e5548f4185646383d6d Mon Sep 17 00:00:00 2001 From: David Date: Wed, 23 Dec 2020 13:24:14 +0100 Subject: [PATCH] Remove custom Json serializer from MediaBrowser.Controller --- MediaBrowser.Controller/Entities/CollectionFolder.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/MediaBrowser.Controller/Entities/CollectionFolder.cs b/MediaBrowser.Controller/Entities/CollectionFolder.cs index d25545a2f..b960278b8 100644 --- a/MediaBrowser.Controller/Entities/CollectionFolder.cs +++ b/MediaBrowser.Controller/Entities/CollectionFolder.cs @@ -4,9 +4,11 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; +using System.Text.Json; using System.Text.Json.Serialization; using System.Threading; using System.Threading.Tasks; +using MediaBrowser.Common.Json; using MediaBrowser.Controller.IO; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Providers; @@ -26,8 +28,6 @@ namespace MediaBrowser.Controller.Entities { public static IXmlSerializer XmlSerializer { get; set; } - public static IJsonSerializer JsonSerializer { get; set; } - public static IServerApplicationHost ApplicationHost { get; set; } public CollectionFolder() @@ -122,7 +122,8 @@ namespace MediaBrowser.Controller.Entities { LibraryOptions[path] = options; - var clone = JsonSerializer.DeserializeFromString(JsonSerializer.SerializeToString(options)); + var jsonOptions = JsonDefaults.GetOptions(); + var clone = JsonSerializer.Deserialize(JsonSerializer.Serialize(options, jsonOptions), jsonOptions); foreach (var mediaPath in clone.PathInfos) { if (!string.IsNullOrEmpty(mediaPath.Path))