diff options
| author | Joshua M. Boniface <joshua@boniface.me> | 2019-10-20 15:16:01 -0400 |
|---|---|---|
| committer | Joshua Boniface <joshua@boniface.me> | 2019-10-20 15:17:39 -0400 |
| commit | 6e59671cf6e8214406c74bae8aec80a49c6e72b3 (patch) | |
| tree | 4495f913820480efd7150246ddd6cb4326bb74c3 /Emby.Server.Implementations | |
| parent | 86a50367b2a72f97450dc6fba4af4c0ec9984a55 (diff) | |
Merge pull request #1898 from Bond-009/jsonfix
Fix Json serialization error
(cherry picked from commit 91600b1c81872e1745401942633a87085dc706b5)
Signed-off-by: Joshua Boniface <joshua@boniface.me>
Diffstat (limited to 'Emby.Server.Implementations')
| -rw-r--r-- | Emby.Server.Implementations/Playlists/ManualPlaylistsFolder.cs | 8 | ||||
| -rw-r--r-- | Emby.Server.Implementations/Services/ServicePath.cs | 19 |
2 files changed, 13 insertions, 14 deletions
diff --git a/Emby.Server.Implementations/Playlists/ManualPlaylistsFolder.cs b/Emby.Server.Implementations/Playlists/ManualPlaylistsFolder.cs index f4decc856..de51a37ab 100644 --- a/Emby.Server.Implementations/Playlists/ManualPlaylistsFolder.cs +++ b/Emby.Server.Implementations/Playlists/ManualPlaylistsFolder.cs @@ -1,9 +1,9 @@ using System.Collections.Generic; using System.Linq; +using System.Text.Json.Serialization; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Playlists; using MediaBrowser.Model.Querying; -using MediaBrowser.Model.Serialization; namespace Emby.Server.Implementations.Playlists { @@ -24,13 +24,13 @@ namespace Emby.Server.Implementations.Playlists return base.GetEligibleChildrenForRecursiveChildren(user).OfType<Playlist>(); } - [IgnoreDataMember] + [JsonIgnore] public override bool IsHidden => true; - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsInheritedParentImages => false; - [IgnoreDataMember] + [JsonIgnore] public override string CollectionType => MediaBrowser.Model.Entities.CollectionType.Playlists; protected override QueryResult<BaseItem> GetItemsInternal(InternalItemsQuery query) diff --git a/Emby.Server.Implementations/Services/ServicePath.cs b/Emby.Server.Implementations/Services/ServicePath.cs index ccb28e8df..0b67669b9 100644 --- a/Emby.Server.Implementations/Services/ServicePath.cs +++ b/Emby.Server.Implementations/Services/ServicePath.cs @@ -4,6 +4,7 @@ using System.IO; using System.Linq; using System.Reflection; using System.Text; +using System.Text.Json.Serialization; namespace Emby.Server.Implementations.Services { @@ -28,6 +29,13 @@ namespace Emby.Server.Implementations.Services private readonly bool[] isWildcard; private readonly int wildcardCount = 0; + internal static string[] IgnoreAttributesNamed = new[] + { + nameof(JsonIgnoreAttribute) + }; + + private static Type _excludeType = typeof(Stream); + public int VariableArgsCount { get; set; } /// <summary> @@ -190,21 +198,12 @@ namespace Emby.Server.Implementations.Services StringComparer.OrdinalIgnoreCase); } - internal static string[] IgnoreAttributesNamed = new[] - { - "IgnoreDataMemberAttribute", - "JsonIgnoreAttribute" - }; - - - private static Type excludeType = typeof(Stream); - internal static IEnumerable<PropertyInfo> GetSerializableProperties(Type type) { foreach (var prop in GetPublicProperties(type)) { if (prop.GetMethod == null - || excludeType == prop.PropertyType) + || _excludeType == prop.PropertyType) { continue; } |
