Skip to content

Commit

Permalink
fix: distinct movies by id
Browse files Browse the repository at this point in the history
  • Loading branch information
revam committed Sep 22, 2024
1 parent 079f80b commit 6b5b960
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions Shoko.Server/API/v3/Controllers/SeriesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1209,6 +1209,7 @@ public ActionResult<List<TmdbMovie>> GetTMDBMoviesBySeriesID(
return Forbid(SeriesForbiddenForUser);

return series.TmdbMovieCrossReferences
.DistinctBy(o => o.TmdbMovieID)
.Select(o => o.TmdbMovie)
.WhereNotNull()
.Select(tmdbMovie => new TmdbMovie(tmdbMovie, include?.CombineFlags(), language))
Expand Down
1 change: 1 addition & 0 deletions Shoko.Server/Models/SVR_AnimeSeries.cs
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ public IReadOnlyList<IImageMetadata> GetImages(ImageEntityType? entityType = nul
public IReadOnlyList<CrossRef_AniDB_TMDB_Movie> TmdbMovieCrossReferences => RepoFactory.CrossRef_AniDB_TMDB_Movie.GetByAnidbAnimeID(AniDB_ID);

public IReadOnlyList<TMDB_Movie> TmdbMovies => TmdbMovieCrossReferences
.DistinctBy(xref => xref.TmdbMovieID)
.Select(xref => xref.TmdbMovie)
.WhereNotNull()
.ToList();
Expand Down

0 comments on commit 6b5b960

Please sign in to comment.