1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-04 10:02:40 +01:00

New: Allow query by TMDbId on Movies endpoint

This commit is contained in:
Qstick 2020-04-10 23:45:26 -04:00
parent 9f35dcd900
commit 6739bf72c4

View File

@ -87,7 +87,17 @@ public MovieModule(IBroadcastSignalRMessage signalRBroadcaster,
private List<MovieResource> AllMovie()
{
var moviesResources = _moviesService.GetAllMovies().ToResource(_qualityUpgradableSpecification);
var tmdbId = Request.GetIntegerQueryParameter("tmdbId");
var moviesResources = new List<MovieResource>();
if (tmdbId > 0)
{
moviesResources.AddIfNotNull(_moviesService.FindByTmdbId(tmdbId).ToResource(_qualityUpgradableSpecification));
}
else
{
moviesResources.AddRange(_moviesService.GetAllMovies().ToResource(_qualityUpgradableSpecification));
}
MapCoversToLocal(moviesResources.ToArray());
PopulateAlternateTitles(moviesResources);