diff --git a/Shoko.Server/API/v3/Controllers/TreeController.cs b/Shoko.Server/API/v3/Controllers/TreeController.cs index c66b3d5c2..280e50b63 100644 --- a/Shoko.Server/API/v3/Controllers/TreeController.cs +++ b/Shoko.Server/API/v3/Controllers/TreeController.cs @@ -537,14 +537,15 @@ public ActionResult GetMainSeriesInGroup([FromRoute] int groupID, [FromQ /// Include hidden episodes in the list. /// Include data from selected s. /// Include watched episodes in the list. - /// Filter episodes by the specified . + /// Filter episodes by the specified s. /// A list of episodes based on the specified filters. [HttpGet("Series/{seriesID}/Episode")] public ActionResult> GetEpisodes([FromRoute] int seriesID, [FromQuery] [Range(0, 1000)] int pageSize = 20, [FromQuery] [Range(1, int.MaxValue)] int page = 1, [FromQuery] IncludeOnlyFilter includeMissing = IncludeOnlyFilter.False, [FromQuery] IncludeOnlyFilter includeHidden = IncludeOnlyFilter.False, [FromQuery, ModelBinder(typeof(CommaDelimitedModelBinder))] HashSet includeDataFrom = null, - [FromQuery] IncludeOnlyFilter includeWatched = IncludeOnlyFilter.True, [FromQuery] EpisodeType? type = null) + [FromQuery] IncludeOnlyFilter includeWatched = IncludeOnlyFilter.True, + [FromQuery, ModelBinder(typeof(CommaDelimitedModelBinder))] HashSet type = null) { var series = RepoFactory.AnimeSeries.GetByID(seriesID); if (series == null) @@ -565,8 +566,12 @@ [FromQuery] [Range(0, 1000)] int pageSize = 20, [FromQuery] [Range(1, int.MaxVal return false; // Filter by episode type, if specified - if (type.HasValue && type.Value != Episode.MapAniDBEpisodeType((AniDBEpisodeType)a.AniDB_Episode.EpisodeType)) - return false; + if (type != null) + { + var mappedType = Episode.MapAniDBEpisodeType((AniDBEpisodeType)a.AniDB_Episode.EpisodeType); + if (!type.Contains(mappedType)) + return false; + } // Filter by availability, if specified if (includeMissing != IncludeOnlyFilter.True)