mirror of
https://github.com/sct/overseerr.git
synced 2025-09-17 17:24:35 +02:00
feat(frontend/api): beginning of new request modal
also includes new api endpoints for seasons
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { Router } from 'express';
|
||||
import TheMovieDb from '../api/themoviedb';
|
||||
import { MediaRequest } from '../entity/MediaRequest';
|
||||
import { mapTvDetails } from '../models/Tv';
|
||||
import { mapTvDetails, mapSeasonWithEpisodes } from '../models/Tv';
|
||||
import { mapTvResult } from '../models/Search';
|
||||
import Media from '../entity/Media';
|
||||
|
||||
@@ -20,6 +20,18 @@ tvRoutes.get('/:id', async (req, res) => {
|
||||
return res.status(200).json(mapTvDetails(tv, media));
|
||||
});
|
||||
|
||||
tvRoutes.get('/:id/season/:seasonNumber', async (req, res) => {
|
||||
const tmdb = new TheMovieDb();
|
||||
|
||||
const season = await tmdb.getTvSeason({
|
||||
tvId: Number(req.params.id),
|
||||
seasonNumber: Number(req.params.seasonNumber),
|
||||
language: req.query.language as string,
|
||||
});
|
||||
|
||||
return res.status(200).json(mapSeasonWithEpisodes(season));
|
||||
});
|
||||
|
||||
tvRoutes.get('/:id/recommendations', async (req, res) => {
|
||||
const tmdb = new TheMovieDb();
|
||||
|
||||
|
Reference in New Issue
Block a user