fix: multiple genre filtering now works (#3282)

pull/3283/head
Brandon Cohen 2 years ago committed by GitHub
parent f4a22dc437
commit 507693881b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -4418,7 +4418,7 @@ paths:
- in: query
name: genre
schema:
type: number
type: string
example: 18
- in: query
name: network

@ -85,7 +85,7 @@ interface DiscoverTvOptions {
voteAverageLte?: string;
includeEmptyReleaseDate?: boolean;
originalLanguage?: string;
genre?: number;
genre?: string;
network?: number;
keywords?: string;
sortBy?: SortOptions;

@ -356,7 +356,7 @@ discoverRoutes.get('/tv', async (req, res, next) => {
page: Number(query.page),
sortBy: query.sortBy as SortOptions,
language: req.locale ?? query.language,
genre: query.genre ? Number(query.genre) : undefined,
genre: query.genre,
network: query.network ? Number(query.network) : undefined,
firstAirDateLte: query.firstAirDateLte
? new Date(query.firstAirDateLte).toISOString().split('T')[0]
@ -491,7 +491,7 @@ discoverRoutes.get<{ genreId: string }>(
const data = await tmdb.getDiscoverTv({
page: Number(req.query.page),
language: req.locale ?? (req.query.language as string),
genre: Number(req.params.genreId),
genre: req.params.genreId,
});
const media = await Media.getRelatedMedia(
@ -770,7 +770,9 @@ discoverRoutes.get<{ language: string }, GenreSliderItem[]>(
await Promise.all(
genres.map(async (genre) => {
const genreData = await tmdb.getDiscoverTv({ genre: genre.id });
const genreData = await tmdb.getDiscoverTv({
genre: genre.id.toString(),
});
mappedGenres.push({
id: genre.id,

Loading…
Cancel
Save