From 996542a4a5f5013bf73d3b8fa4ff4168a5231af4 Mon Sep 17 00:00:00 2001 From: Qstick Date: Sun, 31 Dec 2023 11:29:32 -0600 Subject: [PATCH] Reduce size of Collection on Movie endpoint Ensures we don't send false data and reduces the object size to only what's necessary here. Closes #9521 --- src/Radarr.Api.V3/Movies/MovieCollectionResource.cs | 8 ++++++++ src/Radarr.Api.V3/Movies/MovieResource.cs | 5 ++--- 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 src/Radarr.Api.V3/Movies/MovieCollectionResource.cs diff --git a/src/Radarr.Api.V3/Movies/MovieCollectionResource.cs b/src/Radarr.Api.V3/Movies/MovieCollectionResource.cs new file mode 100644 index 000000000..91b66f342 --- /dev/null +++ b/src/Radarr.Api.V3/Movies/MovieCollectionResource.cs @@ -0,0 +1,8 @@ +namespace Radarr.Api.V3.Movies +{ + public class MovieCollectionResource + { + public string Title { get; set; } + public int TmdbId { get; set; } + } +} diff --git a/src/Radarr.Api.V3/Movies/MovieResource.cs b/src/Radarr.Api.V3/Movies/MovieResource.cs index 659fd1131..344f5a772 100644 --- a/src/Radarr.Api.V3/Movies/MovieResource.cs +++ b/src/Radarr.Api.V3/Movies/MovieResource.cs @@ -7,7 +7,6 @@ using NzbDrone.Core.Languages; using NzbDrone.Core.MediaCover; using NzbDrone.Core.Movies; -using NzbDrone.Core.Movies.Collections; using NzbDrone.Core.Movies.Translations; using NzbDrone.Core.Parser; using Radarr.Api.V3.MovieFiles; @@ -76,7 +75,7 @@ public MovieResource() public AddMovieOptions AddOptions { get; set; } public Ratings Ratings { get; set; } public MovieFileResource MovieFile { get; set; } - public MovieCollection Collection { get; set; } + public MovieCollectionResource Collection { get; set; } public float Popularity { get; set; } } @@ -96,7 +95,7 @@ public static MovieResource ToResource(this Movie model, int availDelay, MovieTr var translatedTitle = movieTranslation?.Title ?? model.Title; var translatedOverview = movieTranslation?.Overview ?? model.MovieMetadata.Value.Overview; - var collection = model.MovieMetadata.Value.CollectionTmdbId > 0 ? new MovieCollection { Title = model.MovieMetadata.Value.CollectionTitle, TmdbId = model.MovieMetadata.Value.CollectionTmdbId } : null; + var collection = model.MovieMetadata.Value.CollectionTmdbId > 0 ? new MovieCollectionResource { Title = model.MovieMetadata.Value.CollectionTitle, TmdbId = model.MovieMetadata.Value.CollectionTmdbId } : null; return new MovieResource {