From 64739712c6a2c35e631b1e9cd216e66786ea9373 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Mon, 2 Dec 2024 15:29:50 +0200 Subject: [PATCH] Add return type for movie lookup and import endpoints Closes #10737 --- src/Radarr.Api.V3/Movies/MovieImportController.cs | 4 +++- src/Radarr.Api.V3/Movies/MovieLookupController.cs | 9 ++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Radarr.Api.V3/Movies/MovieImportController.cs b/src/Radarr.Api.V3/Movies/MovieImportController.cs index c7078288d..f923a4365 100644 --- a/src/Radarr.Api.V3/Movies/MovieImportController.cs +++ b/src/Radarr.Api.V3/Movies/MovieImportController.cs @@ -29,7 +29,9 @@ protected override MovieResource GetResourceById(int id) } [HttpPost] - public object Import([FromBody] List resource) + [Consumes("application/json")] + [Produces("application/json")] + public IEnumerable Import([FromBody] List resource) { var newMovies = resource.ToModel(); diff --git a/src/Radarr.Api.V3/Movies/MovieLookupController.cs b/src/Radarr.Api.V3/Movies/MovieLookupController.cs index 7b7d11747..3d8729e18 100644 --- a/src/Radarr.Api.V3/Movies/MovieLookupController.cs +++ b/src/Radarr.Api.V3/Movies/MovieLookupController.cs @@ -54,7 +54,8 @@ protected override MovieResource GetResourceById(int id) } [HttpGet("tmdb")] - public object SearchByTmdbId(int tmdbId) + [Produces("application/json")] + public MovieResource SearchByTmdbId(int tmdbId) { var availDelay = _configService.AvailabilityDelay; var result = new Movie { MovieMetadata = _movieInfo.GetMovieInfo(tmdbId).Item1 }; @@ -63,7 +64,8 @@ public object SearchByTmdbId(int tmdbId) } [HttpGet("imdb")] - public object SearchByImdbId(string imdbId) + [Produces("application/json")] + public MovieResource SearchByImdbId(string imdbId) { var result = new Movie { MovieMetadata = _movieInfo.GetMovieByImdbId(imdbId) }; @@ -73,7 +75,8 @@ public object SearchByImdbId(string imdbId) } [HttpGet] - public object Search([FromQuery] string term) + [Produces("application/json")] + public IEnumerable Search([FromQuery] string term) { var searchResults = _searchProxy.SearchForNewMovie(term);