Api/v2 #111
@@ -12,11 +12,15 @@ const plex = new Plex(configuration.get('plex', 'ip'));
|
|||||||
* @param {Response} res
|
* @param {Response} res
|
||||||
* @returns {Callback}
|
* @returns {Callback}
|
||||||
*/
|
*/
|
||||||
function movieInfoController(req, res) {
|
async function movieInfoController(req, res) {
|
||||||
const movieId = req.params.id;
|
const movieId = req.params.id;
|
||||||
tmdb.movieInfo(movieId)
|
const { credits } = req.query;
|
||||||
.then((movie) => plex.existsInPlex(movie))
|
const movie = await tmdb.movieInfo(movieId, credits);
|
||||||
.then((movie) => {
|
|
||||||
|
plex.existsInPlex(movie)
|
||||||
|
.catch((error) => { console.log('Error when searching plex'); })
|
||||||
|
.then(() => {
|
||||||
|
console.log('movie', movie)
|
||||||
res.send(movie);
|
res.send(movie);
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
res.status(404).send({ success: false, error: error.message });
|
res.status(404).send({ success: false, error: error.message });
|
||||||
|
|||||||
Reference in New Issue
Block a user