From 21a4f1acb0141867e43db955b97c50aab3e8cb52 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sun, 28 Apr 2013 13:17:41 -0400 Subject: Don't filter characters with role=Actor Because there was a mysterious error when I was getting results for role=Voice. Shoot. Spent too much time on that. --- routes/character-images.js | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/routes/character-images.js b/routes/character-images.js index 581f5b6..f506fdd 100644 --- a/routes/character-images.js +++ b/routes/character-images.js @@ -20,20 +20,22 @@ module.exports = function(req, res) { var actor_count = r.cast.length; var the_other = that; for (var i = 0; i < r.cast.length; i++) { - if (r.cast[i].role === 'Actor') { - that.person_request(r.cast[i].personId, {character_name: r.cast[i].characterName}, function(success) { - if (request_count == (r.cast.length - 1)) { - the_other.render(); - } - - if (!success) { - actor_count--; - } - request_count++; - }); - } + that.person_request(r.cast[i].personId, {character_name: r.cast[i].characterName}, function(success) { + if (request_count == (actor_count - 1)) { + the_other.render(); + } + + if (!success) { + actor_count--; + } + request_count++; + }); } } + else { + console.log('ERROR:'+error); + console.log('STATUS-CODE:'+response.statusCode); + } }); }; @@ -52,7 +54,6 @@ module.exports = function(req, res) { name: params.character_name, tms_personId: r.personId }); - console.log(r); callback(true); } -- cgit v1.2.3