Skip to content

Commit

Permalink
fix: convert episode images from a list to the images DTO model
Browse files Browse the repository at this point in the history
  • Loading branch information
revam committed Dec 1, 2024
1 parent 10467fe commit 0af72dc
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions Shoko.Server/API/v3/Controllers/TmdbController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2120,7 +2120,7 @@ public ActionResult<IReadOnlyList<Overview>> GetOverviewsForTmdbEpisodeByEpisode
}

[HttpGet("Episode/{episodeID}/Images")]
public ActionResult<IReadOnlyList<Image>> GetImagesForTmdbEpisodeByEpisodeID(
public ActionResult<Images> GetImagesForTmdbEpisodeByEpisodeID(
[FromRoute] int episodeID,
[FromQuery, ModelBinder(typeof(CommaDelimitedModelBinder))] HashSet<TitleLanguage>? language = null
)
Expand All @@ -2129,10 +2129,7 @@ public ActionResult<IReadOnlyList<Image>> GetImagesForTmdbEpisodeByEpisodeID(
if (episode is null)
return NotFound(EpisodeNotFound);

return episode.GetImages()
.InLanguage(language)
.Select(image => new Image(image))
.ToList();
return episode.GetImages().ToDto(language, includeThumbnails: true);
}

[HttpGet("Episode/{episodeID}/Cast")]
Expand Down

0 comments on commit 0af72dc

Please sign in to comment.