From 959f6be019c05d65ff272c2c65f854eeef5d4001 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Tue, 14 May 2024 00:48:01 +0300 Subject: [PATCH] Ignore `Grabbed` with STJson (cherry picked from commit cc5b5463f225604a29820e026a43d7dc33f0ffa5) Closes #4824 --- src/Lidarr.Api.V1/Albums/AlbumResource.cs | 4 ++-- src/Lidarr.Api.V1/Tracks/TrackResource.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Lidarr.Api.V1/Albums/AlbumResource.cs b/src/Lidarr.Api.V1/Albums/AlbumResource.cs index 7a3d2a561..072fb2d27 100644 --- a/src/Lidarr.Api.V1/Albums/AlbumResource.cs +++ b/src/Lidarr.Api.V1/Albums/AlbumResource.cs @@ -1,9 +1,9 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Text.Json.Serialization; using Lidarr.Api.V1.Artist; using Lidarr.Http.REST; -using Newtonsoft.Json; using NzbDrone.Core.MediaCover; using NzbDrone.Core.Music; using Swashbuckle.AspNetCore.Annotations; @@ -49,7 +49,7 @@ namespace Lidarr.Api.V1.Albums public string RemoteCover { get; set; } // Hiding this so people don't think its usable (only used to set the initial state) - [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] [SwaggerIgnore] public bool Grabbed { get; set; } } diff --git a/src/Lidarr.Api.V1/Tracks/TrackResource.cs b/src/Lidarr.Api.V1/Tracks/TrackResource.cs index 6e66e7922..4c82d0471 100644 --- a/src/Lidarr.Api.V1/Tracks/TrackResource.cs +++ b/src/Lidarr.Api.V1/Tracks/TrackResource.cs @@ -1,9 +1,9 @@ using System.Collections.Generic; using System.Linq; +using System.Text.Json.Serialization; using Lidarr.Api.V1.Artist; using Lidarr.Api.V1.TrackFiles; using Lidarr.Http.REST; -using Newtonsoft.Json; using NzbDrone.Core.Music; using Swashbuckle.AspNetCore.Annotations; @@ -29,7 +29,7 @@ namespace Lidarr.Api.V1.Tracks public Ratings Ratings { get; set; } // Hiding this so people don't think its usable (only used to set the initial state) - [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] [SwaggerIgnore] public bool Grabbed { get; set; } }