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