1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-22 07:52:34 +00:00

Add return type for movie lookup and import endpoints

Closes #10737
This commit is contained in:
Bogdan 2024-12-02 15:29:50 +02:00
parent 6ac9cca953
commit 64739712c6
2 changed files with 9 additions and 4 deletions

View file

@ -29,7 +29,9 @@ protected override MovieResource GetResourceById(int id)
}
[HttpPost]
public object Import([FromBody] List<MovieResource> resource)
[Consumes("application/json")]
[Produces("application/json")]
public IEnumerable<MovieResource> Import([FromBody] List<MovieResource> resource)
{
var newMovies = resource.ToModel();

View file

@ -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<MovieResource> Search([FromQuery] string term)
{
var searchResults = _searchProxy.SearchForNewMovie(term);