mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-20 09:04:42 +01:00
Fix Json serialization error
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user