|
|
|
@ -164,7 +164,7 @@ discoverRoutes.get<{ language: string }>(
|
|
|
|
|
|
|
|
|
|
const data = await tmdb.getDiscoverMovies({
|
|
|
|
|
page: Number(req.query.page),
|
|
|
|
|
language: req.locale ?? (req.query.language as string),
|
|
|
|
|
language: (req.query.language as string) ?? req.locale,
|
|
|
|
|
originalLanguage: req.params.language,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -208,7 +208,7 @@ discoverRoutes.get<{ genreId: string }>(
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
const genres = await tmdb.getMovieGenres({
|
|
|
|
|
language: req.locale ?? (req.query.language as string),
|
|
|
|
|
language: (req.query.language as string) ?? req.locale,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const genre = genres.find(
|
|
|
|
@ -221,7 +221,7 @@ discoverRoutes.get<{ genreId: string }>(
|
|
|
|
|
|
|
|
|
|
const data = await tmdb.getDiscoverMovies({
|
|
|
|
|
page: Number(req.query.page),
|
|
|
|
|
language: req.locale ?? (req.query.language as string),
|
|
|
|
|
language: (req.query.language as string) ?? req.locale,
|
|
|
|
|
genre: req.params.genreId as string,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -268,7 +268,7 @@ discoverRoutes.get<{ studioId: string }>(
|
|
|
|
|
|
|
|
|
|
const data = await tmdb.getDiscoverMovies({
|
|
|
|
|
page: Number(req.query.page),
|
|
|
|
|
language: req.locale ?? (req.query.language as string),
|
|
|
|
|
language: (req.query.language as string) ?? req.locale,
|
|
|
|
|
studio: req.params.studioId as string,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -317,7 +317,7 @@ discoverRoutes.get('/movies/upcoming', async (req, res, next) => {
|
|
|
|
|
try {
|
|
|
|
|
const data = await tmdb.getDiscoverMovies({
|
|
|
|
|
page: Number(req.query.page),
|
|
|
|
|
language: req.locale ?? (req.query.language as string),
|
|
|
|
|
language: (req.query.language as string) ?? req.locale,
|
|
|
|
|
primaryReleaseDateGte: date,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -440,7 +440,7 @@ discoverRoutes.get<{ language: string }>(
|
|
|
|
|
|
|
|
|
|
const data = await tmdb.getDiscoverTv({
|
|
|
|
|
page: Number(req.query.page),
|
|
|
|
|
language: req.locale ?? (req.query.language as string),
|
|
|
|
|
language: (req.query.language as string) ?? req.locale,
|
|
|
|
|
originalLanguage: req.params.language,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -484,7 +484,7 @@ discoverRoutes.get<{ genreId: string }>(
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
const genres = await tmdb.getTvGenres({
|
|
|
|
|
language: req.locale ?? (req.query.language as string),
|
|
|
|
|
language: (req.query.language as string) ?? req.locale,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const genre = genres.find(
|
|
|
|
@ -497,7 +497,7 @@ discoverRoutes.get<{ genreId: string }>(
|
|
|
|
|
|
|
|
|
|
const data = await tmdb.getDiscoverTv({
|
|
|
|
|
page: Number(req.query.page),
|
|
|
|
|
language: req.locale ?? (req.query.language as string),
|
|
|
|
|
language: (req.query.language as string) ?? req.locale,
|
|
|
|
|
genre: req.params.genreId,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -544,7 +544,7 @@ discoverRoutes.get<{ networkId: string }>(
|
|
|
|
|
|
|
|
|
|
const data = await tmdb.getDiscoverTv({
|
|
|
|
|
page: Number(req.query.page),
|
|
|
|
|
language: req.locale ?? (req.query.language as string),
|
|
|
|
|
language: (req.query.language as string) ?? req.locale,
|
|
|
|
|
network: Number(req.params.networkId),
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -593,7 +593,7 @@ discoverRoutes.get('/tv/upcoming', async (req, res, next) => {
|
|
|
|
|
try {
|
|
|
|
|
const data = await tmdb.getDiscoverTv({
|
|
|
|
|
page: Number(req.query.page),
|
|
|
|
|
language: req.locale ?? (req.query.language as string),
|
|
|
|
|
language: (req.query.language as string) ?? req.locale,
|
|
|
|
|
firstAirDateGte: date,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -632,7 +632,7 @@ discoverRoutes.get('/trending', async (req, res, next) => {
|
|
|
|
|
try {
|
|
|
|
|
const data = await tmdb.getAllTrending({
|
|
|
|
|
page: Number(req.query.page),
|
|
|
|
|
language: req.locale ?? (req.query.language as string),
|
|
|
|
|
language: (req.query.language as string) ?? req.locale,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const media = await Media.getRelatedMedia(
|
|
|
|
@ -686,7 +686,7 @@ discoverRoutes.get<{ keywordId: string }>(
|
|
|
|
|
const data = await tmdb.getMoviesByKeyword({
|
|
|
|
|
keywordId: Number(req.params.keywordId),
|
|
|
|
|
page: Number(req.query.page),
|
|
|
|
|
language: req.locale ?? (req.query.language as string),
|
|
|
|
|
language: (req.query.language as string) ?? req.locale,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const media = await Media.getRelatedMedia(
|
|
|
|
@ -730,7 +730,7 @@ discoverRoutes.get<{ language: string }, GenreSliderItem[]>(
|
|
|
|
|
const mappedGenres: GenreSliderItem[] = [];
|
|
|
|
|
|
|
|
|
|
const genres = await tmdb.getMovieGenres({
|
|
|
|
|
language: req.locale ?? (req.query.language as string),
|
|
|
|
|
language: (req.query.language as string) ?? req.locale,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
await Promise.all(
|
|
|
|
@ -774,7 +774,7 @@ discoverRoutes.get<{ language: string }, GenreSliderItem[]>(
|
|
|
|
|
const mappedGenres: GenreSliderItem[] = [];
|
|
|
|
|
|
|
|
|
|
const genres = await tmdb.getTvGenres({
|
|
|
|
|
language: req.locale ?? (req.query.language as string),
|
|
|
|
|
language: (req.query.language as string) ?? req.locale,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
await Promise.all(
|
|
|
|
|