bu fixes
This commit is contained in:
@@ -3,7 +3,8 @@ const GetFlix = require('../index');
|
|||||||
const getflix = new GetFlix('d9d6007d1bcf12043db5a085ae3e5bbb');
|
const getflix = new GetFlix('d9d6007d1bcf12043db5a085ae3e5bbb');
|
||||||
const getInfo = async () => {
|
const getInfo = async () => {
|
||||||
try {
|
try {
|
||||||
const info = await getflix.get(80209184, 'tr-TR');
|
const info = await getflix.get(80244780, 'tr-TR');
|
||||||
|
// info.credits.cast.forEach((f) => console.log(f.profile_path));
|
||||||
console.log(info);
|
console.log(info);
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ module.exports.getDetails = function (detailsId, movieOrTv, tmdbApiKey, language
|
|||||||
const detailURL = config.theMovieDbURL + movieOrTv + '/' + detailsId + '?api_key=' + tmdbApiKey + '&language=' + language;
|
const detailURL = config.theMovieDbURL + movieOrTv + '/' + detailsId + '?api_key=' + tmdbApiKey + '&language=' + language;
|
||||||
|
|
||||||
request(detailURL, (err, resultBody, body) => {
|
request(detailURL, (err, resultBody, body) => {
|
||||||
|
if (resultBody != '') {
|
||||||
const getJson = JSON.parse(resultBody.body);
|
const getJson = JSON.parse(resultBody.body);
|
||||||
|
|
||||||
if (getJson.status_code > 1) {
|
if (getJson.status_code > 1) {
|
||||||
@@ -30,7 +30,11 @@ module.exports.getDetails = function (detailsId, movieOrTv, tmdbApiKey, language
|
|||||||
cb(error, result);
|
cb(error, result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
const error = 'tmdb get detail api connection error';
|
||||||
|
const result = null;
|
||||||
|
cb(error, result);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
Reference in New Issue
Block a user