From c9aa59340c945174dfad4c8ecf8c8d7d83dccd61 Mon Sep 17 00:00:00 2001 From: ManiMatter <124743318+ManiMatter@users.noreply.github.com> Date: Sat, 21 Sep 2024 19:16:05 +0200 Subject: [PATCH] Add 'includeSeries' and 'includeEpisodeFile' to Episode API endpoint --- src/Sonarr.Api.V3/Episodes/EpisodeController.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Sonarr.Api.V3/Episodes/EpisodeController.cs b/src/Sonarr.Api.V3/Episodes/EpisodeController.cs index 7b53a1f54..326bc36a9 100644 --- a/src/Sonarr.Api.V3/Episodes/EpisodeController.cs +++ b/src/Sonarr.Api.V3/Episodes/EpisodeController.cs @@ -25,24 +25,24 @@ namespace Sonarr.Api.V3.Episodes [HttpGet] [Produces("application/json")] - public List GetEpisodes(int? seriesId, int? seasonNumber, [FromQuery]List episodeIds, int? episodeFileId, bool includeImages = false) + public List GetEpisodes(int? seriesId, int? seasonNumber, [FromQuery]List episodeIds, int? episodeFileId, bool includeSeries = false, bool includeEpisodeFile = false, bool includeImages = false) { if (seriesId.HasValue) { if (seasonNumber.HasValue) { - return MapToResource(_episodeService.GetEpisodesBySeason(seriesId.Value, seasonNumber.Value), false, false, includeImages); + return MapToResource(_episodeService.GetEpisodesBySeason(seriesId.Value, seasonNumber.Value), includeSeries, includeEpisodeFile, includeImages); } - return MapToResource(_episodeService.GetEpisodeBySeries(seriesId.Value), false, false, includeImages); + return MapToResource(_episodeService.GetEpisodeBySeries(seriesId.Value), includeSeries, includeEpisodeFile, includeImages); } else if (episodeIds.Any()) { - return MapToResource(_episodeService.GetEpisodes(episodeIds), false, false, includeImages); + return MapToResource(_episodeService.GetEpisodes(episodeIds), includeSeries, includeEpisodeFile, includeImages); } else if (episodeFileId.HasValue) { - return MapToResource(_episodeService.GetEpisodesByFileId(episodeFileId.Value), false, false, includeImages); + return MapToResource(_episodeService.GetEpisodesByFileId(episodeFileId.Value), includeSeries, includeEpisodeFile, includeImages); } throw new BadRequestException("seriesId or episodeIds must be provided");