mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-30 19:54:16 -04:00
Remove some json ignores on ids
This commit is contained in:
parent
0c0037416a
commit
ec6b90b33c
@ -129,7 +129,6 @@ namespace Kyoo.Abstractions.Models
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The ID of the Studio that made this show.
|
/// The ID of the Studio that made this show.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonIgnore]
|
|
||||||
public Guid? StudioId { get; set; }
|
public Guid? StudioId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -57,7 +57,6 @@ namespace Kyoo.Abstractions.Models
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The ID of the user that started watching this episode.
|
/// The ID of the user that started watching this episode.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SerializeIgnore]
|
|
||||||
public Guid UserId { get; set; }
|
public Guid UserId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -69,7 +68,6 @@ namespace Kyoo.Abstractions.Models
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The ID of the movie started.
|
/// The ID of the movie started.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SerializeIgnore]
|
|
||||||
public Guid MovieId { get; set; }
|
public Guid MovieId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -114,7 +112,6 @@ namespace Kyoo.Abstractions.Models
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The ID of the user that started watching this episode.
|
/// The ID of the user that started watching this episode.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SerializeIgnore]
|
|
||||||
public Guid UserId { get; set; }
|
public Guid UserId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -126,7 +123,6 @@ namespace Kyoo.Abstractions.Models
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The ID of the episode started.
|
/// The ID of the episode started.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SerializeIgnore]
|
|
||||||
public Guid? EpisodeId { get; set; }
|
public Guid? EpisodeId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -171,7 +167,6 @@ namespace Kyoo.Abstractions.Models
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The ID of the user that started watching this episode.
|
/// The ID of the user that started watching this episode.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SerializeIgnore]
|
|
||||||
public Guid UserId { get; set; }
|
public Guid UserId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -183,7 +178,6 @@ namespace Kyoo.Abstractions.Models
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The ID of the show started.
|
/// The ID of the show started.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SerializeIgnore]
|
|
||||||
public Guid ShowId { get; set; }
|
public Guid ShowId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -213,7 +207,6 @@ namespace Kyoo.Abstractions.Models
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The ID of the episode started.
|
/// The ID of the episode started.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SerializeIgnore]
|
|
||||||
public Guid? NextEpisodeId { get; set; }
|
public Guid? NextEpisodeId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -96,7 +96,7 @@ namespace Kyoo.Core
|
|||||||
.AddJsonOptions(x =>
|
.AddJsonOptions(x =>
|
||||||
{
|
{
|
||||||
x.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter());
|
x.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter());
|
||||||
x.JsonSerializerOptions.TypeInfoResolver = new PolymorphicTypeResolver();
|
x.JsonSerializerOptions.TypeInfoResolver = new WithKindResolver();
|
||||||
x.JsonSerializerOptions.PropertyNamingPolicy = JsonNamingPolicy.CamelCase;
|
x.JsonSerializerOptions.PropertyNamingPolicy = JsonNamingPolicy.CamelCase;
|
||||||
})
|
})
|
||||||
.AddDataAnnotations()
|
.AddDataAnnotations()
|
||||||
|
@ -26,7 +26,7 @@ using static System.Text.Json.JsonNamingPolicy;
|
|||||||
|
|
||||||
namespace Kyoo.Core.Api;
|
namespace Kyoo.Core.Api;
|
||||||
|
|
||||||
public class PolymorphicTypeResolver : DefaultJsonTypeInfoResolver
|
public class WithKindResolver : DefaultJsonTypeInfoResolver
|
||||||
{
|
{
|
||||||
public override JsonTypeInfo GetTypeInfo(Type type, JsonSerializerOptions options)
|
public override JsonTypeInfo GetTypeInfo(Type type, JsonSerializerOptions options)
|
||||||
{
|
{
|
Loading…
x
Reference in New Issue
Block a user