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