diff options
| author | Bond_009 <bond.009@outlook.com> | 2019-10-15 17:49:49 +0200 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2019-10-15 17:49:49 +0200 |
| commit | 5edb8159a7f8966d09cb222f366d7403a9bf723b (patch) | |
| tree | ee1a7acd3a7116236f7d492f4a3ee27816186c56 /Emby.Server.Implementations/Services/ServicePath.cs | |
| parent | 0ccbc2f37444d7deb7981a1e6ac2fafc1a518750 (diff) | |
Fix Json serialization error
Diffstat (limited to 'Emby.Server.Implementations/Services/ServicePath.cs')
| -rw-r--r-- | Emby.Server.Implementations/Services/ServicePath.cs | 19 |
1 files changed, 9 insertions, 10 deletions
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; } |
