From a0b53c3af9e705e517dee09ab1ccd8fcecdba3d5 Mon Sep 17 00:00:00 2001 From: samcm Date: Mon, 5 Dec 2016 14:48:46 +1100 Subject: [PATCH] Debugging console writes for issue #2 --- app/js/plex/PlexServer.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/js/plex/PlexServer.js b/app/js/plex/PlexServer.js index b20244b5..45fc3bf2 100644 --- a/app/js/plex/PlexServer.js +++ b/app/js/plex/PlexServer.js @@ -148,9 +148,10 @@ module.exports = function PlexServer(){ this.hitApi('/library/metadata/'+ratingKey,{},this.chosenConnection,function(result,that){ validResults = [] console.log('Response back from metadata request') - if (result != null){ - // Old Server version compatibility + console.log(result) + if (result != null){ if (result._children) { + // Old Server version compatibility for (var i in result._children){ var res = result._children[i] if (res._elementType == 'Directory' || res._elementType == 'Media' || res._elementType == 'Video'){ @@ -161,8 +162,12 @@ module.exports = function PlexServer(){ // New Server compatibility return callback(result.MediaContainer.Metadata[0],that) } + console.log('Didnt find a compatible PMS Metadata object. Result from the server is below') + console.log(result) return callback(null,that) - } + } + console.log('Didnt find a compatible PMS Metadata object because result == null. Result from the server is below') + console.log(result) return callback(null,that) }) }