mirror of
https://github.com/KevinMidboe/moviedb.git
synced 2025-10-29 17:50:25 +00:00
Added Combined Credits to endpoints
This commit is contained in:
@@ -63,6 +63,7 @@
|
|||||||
, "person" : {
|
, "person" : {
|
||||||
"Info" : { "resource": "person/:id", "method": "get" }
|
"Info" : { "resource": "person/:id", "method": "get" }
|
||||||
, "Credits" : { "resource": "person/:id/credits", "method": "get" }
|
, "Credits" : { "resource": "person/:id/credits", "method": "get" }
|
||||||
|
, "CombinedCredits" : { "resource": "person/:id/combined_credits", "method": "get" }
|
||||||
, "Images" : { "resource": "person/:id/images", "method": "get" }
|
, "Images" : { "resource": "person/:id/images", "method": "get" }
|
||||||
, "Changes" : { "resource": "person/:id/changes", "method": "get" }
|
, "Changes" : { "resource": "person/:id/changes", "method": "get" }
|
||||||
, "Latest" : { "resource": "person/latest", "method": "get" }
|
, "Latest" : { "resource": "person/latest", "method": "get" }
|
||||||
|
|||||||
11
moviedb.js
11
moviedb.js
@@ -68,6 +68,7 @@ module.exports={
|
|||||||
, "person" : {
|
, "person" : {
|
||||||
"Info" : { "resource": "person/:id", "method": "get" }
|
"Info" : { "resource": "person/:id", "method": "get" }
|
||||||
, "Credits" : { "resource": "person/:id/credits", "method": "get" }
|
, "Credits" : { "resource": "person/:id/credits", "method": "get" }
|
||||||
|
, "CombinedCredits" : {"resource":"person/:id/combined_credits", "method":"get"}
|
||||||
, "Images" : { "resource": "person/:id/images", "method": "get" }
|
, "Images" : { "resource": "person/:id/images", "method": "get" }
|
||||||
, "Changes" : { "resource": "person/:id/changes", "method": "get" }
|
, "Changes" : { "resource": "person/:id/changes", "method": "get" }
|
||||||
, "Latest" : { "resource": "person/latest", "method": "get" }
|
, "Latest" : { "resource": "person/latest", "method": "get" }
|
||||||
@@ -179,10 +180,10 @@ Object.keys(endpoints.methods).forEach(function(method){
|
|||||||
if(!this.token || Date.now() > +new Date(this.token.expires_at)) {
|
if(!this.token || Date.now() > +new Date(this.token.expires_at)) {
|
||||||
this.requestToken(function(){
|
this.requestToken(function(){
|
||||||
execMethod.call(self, met[m].method, params, met[m].resource, fn);
|
execMethod.call(self, met[m].method, params, met[m].resource, fn);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
execMethod.call(this, met[m].method, params, met[m].resource, fn);
|
execMethod.call(this, met[m].method, params, met[m].resource, fn);
|
||||||
}
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
@@ -193,7 +194,7 @@ var execMethod = function(type, params, endpoint, fn){
|
|||||||
params = params || {};
|
params = params || {};
|
||||||
endpoint = endpoint.replace(':id', params.id).replace(':season_number', params.season_number).replace(':episode_number', params.episode_number);
|
endpoint = endpoint.replace(':id', params.id).replace(':season_number', params.season_number).replace(':episode_number', params.episode_number);
|
||||||
type = type.toUpperCase();
|
type = type.toUpperCase();
|
||||||
|
|
||||||
var req = request(type, endpoints.base_url + endpoint)
|
var req = request(type, endpoints.base_url + endpoint)
|
||||||
.query({api_key : this.api_key})
|
.query({api_key : this.api_key})
|
||||||
.set('Accept', 'application/json');
|
.set('Accept', 'application/json');
|
||||||
@@ -1467,7 +1468,7 @@ Emitter.prototype.hasListeners = function(event){
|
|||||||
* TODO: combatible error handling?
|
* TODO: combatible error handling?
|
||||||
*/
|
*/
|
||||||
|
|
||||||
module.exports = function(arr, fn, initial){
|
module.exports = function(arr, fn, initial){
|
||||||
var idx = 0;
|
var idx = 0;
|
||||||
var len = arr.length;
|
var len = arr.length;
|
||||||
var curr = arguments.length == 3
|
var curr = arguments.length == 3
|
||||||
@@ -1477,7 +1478,7 @@ module.exports = function(arr, fn, initial){
|
|||||||
while (idx < len) {
|
while (idx < len) {
|
||||||
curr = fn.call(null, curr, arr[idx], ++idx, arr);
|
curr = fn.call(null, curr, arr[idx], ++idx, arr);
|
||||||
}
|
}
|
||||||
|
|
||||||
return curr;
|
return curr;
|
||||||
};
|
};
|
||||||
},{}]},{},[1])(1)
|
},{}]},{},[1])(1)
|
||||||
|
|||||||
2
moviedb.min.js
vendored
2
moviedb.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user