Fixed a bug where if a seach query did not pass anything back when checking existance in plex, then you would get a 404 message.
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const PlexRepository = require('src/plex/plexRepository');
|
const PlexRepository = require('src/plex/plexRepository');
|
||||||
const plexRepository = new PlexRepository();
|
const plexRepository = new PlexRepository();
|
||||||
const convertPlexToMovie = require('src/plex/convertPlexToMovie');
|
|
||||||
const configuration = require('src/config/configuration').getInstance();
|
const configuration = require('src/config/configuration').getInstance();
|
||||||
const TMDB = require('src/tmdb/tmdb');
|
const TMDB = require('src/tmdb/tmdb');
|
||||||
const tmdb = new TMDB(configuration.get('tmdb', 'apiKey'));
|
const tmdb = new TMDB(configuration.get('tmdb', 'apiKey'));
|
||||||
@@ -17,6 +16,8 @@ const nodemailer = require('nodemailer');
|
|||||||
class RequestRepository {
|
class RequestRepository {
|
||||||
|
|
||||||
searchRequest(query, page, type) {
|
searchRequest(query, page, type) {
|
||||||
|
// STRIP METADATA THAT IS NOT ALLOWED
|
||||||
|
|
||||||
return Promise.resolve()
|
return Promise.resolve()
|
||||||
.then(() => tmdb.search(query, page, type))
|
.then(() => tmdb.search(query, page, type))
|
||||||
.then((tmdbMovies) => {
|
.then((tmdbMovies) => {
|
||||||
@@ -33,8 +34,14 @@ class RequestRepository {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
// This is pretty janky, but if there is a error because plex does not not get any results
|
||||||
|
// the tmdbMovies list is just returned without checking plexStatus.
|
||||||
|
.catch((error) => {
|
||||||
|
return tmdbMovies;
|
||||||
|
})
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
console.log(error);
|
||||||
return error;
|
return error;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user