bug fix
This commit is contained in:
@@ -132,28 +132,33 @@ module.exports.getImages = function (detailsId, movieOrTv, tmdbApiKey, cb) {
|
|||||||
|
|
||||||
request(creditsURL, (err, resultBody, body) => {
|
request(creditsURL, (err, resultBody, body) => {
|
||||||
|
|
||||||
const getJson = JSON.parse(resultBody.body);
|
if (resultBody != []) {
|
||||||
|
const getJson = JSON.parse(resultBody.body);
|
||||||
if (getJson.status_code > 1) {
|
if (getJson.status_code > 1) {
|
||||||
// if wrong api key error
|
// if wrong api key error
|
||||||
const error = 'tmdb get images wrong api key error';
|
const error = 'tmdb get images wrong api key error';
|
||||||
const result = null;
|
|
||||||
cb(error, result);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (err) {
|
|
||||||
// if thmdb api connection error
|
|
||||||
const error = 'tmdb get images api connection error';
|
|
||||||
const result = null;
|
const result = null;
|
||||||
cb(error, result);
|
cb(error, result);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const error = null;
|
if (err) {
|
||||||
const result = getJson;
|
// if thmdb api connection error
|
||||||
cb(error, result);
|
const error = 'tmdb get images api connection error';
|
||||||
|
const result = null;
|
||||||
|
cb(error, result);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
const error = null;
|
||||||
|
const result = getJson;
|
||||||
|
cb(error, result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// if wrong api key error
|
||||||
|
const error = 'error getting data';
|
||||||
|
const result = null;
|
||||||
|
cb(error, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "flixinfo",
|
"name": "flixinfo",
|
||||||
"version": "1.1.8",
|
"version": "1.1.9",
|
||||||
"description": "Get movie detail with netflix id",
|
"description": "Get movie detail with netflix id",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"directories": {
|
"directories": {
|
||||||
|
|||||||
Reference in New Issue
Block a user