diff --git a/src/Radarr.Api.V3/Collections/CollectionController.cs b/src/Radarr.Api.V3/Collections/CollectionController.cs index f1438450b..8e08067d4 100644 --- a/src/Radarr.Api.V3/Collections/CollectionController.cs +++ b/src/Radarr.Api.V3/Collections/CollectionController.cs @@ -53,9 +53,25 @@ protected override CollectionResource GetResourceById(int id) } [HttpGet] - public List GetCollections() + public List GetCollections(int? tmdbId) { - return MapToResource(_collectionService.GetAllCollections()).ToList(); + var collectionResources = new List(); + + if (tmdbId.HasValue) + { + var collection = _collectionService.FindByTmdbId(tmdbId.Value); + + if (collection != null) + { + collectionResources.AddIfNotNull(MapToResource(collection)); + } + } + else + { + collectionResources = MapToResource(_collectionService.GetAllCollections()).ToList(); + } + + return collectionResources; } [RestPutById]