KiLMaN / T411-Torznab

A NodeJs proxy to download from T411 in Sonarr
26 stars 15 forks source link

Error researching on IMDB #34

Closed foux closed 7 years ago

foux commented 7 years ago

Hi, Thanks for adding Radarr support! Unfortunately I've got a bug on every IMDB search :

debug:  t=movie, cat=2000,2010,2020,2030,2035,2040,2045,2050,2060, extended=1, apikey=12345, offset=0, limit=50, imdbid=0445760
debug: Requested IMDB Id : 0445760
debug: Movie Cache for 0445760 empty, querying IMDB
debug: undefined
Unhandled rejection TypeError: Cannot read property 'title' of undefined
    at researchMovie (/opt/t411-torznav/server.js:213:21)
    at /opt/t411-torznav/server.js:387:8
    at /opt/t411-torznav/node_modules/imdb-api/lib/imdb.js:188:13
    at tryCatcher (/opt/t411-torznav/node_modules/request-promise/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/opt/t411-torznav/node_modules/request-promise/node_modules/bluebird/js/release/promise.js:510:31)
    at Promise._settlePromise (/opt/t411-torznav/node_modules/request-promise/node_modules/bluebird/js/release/promise.js:567:18)
    at Promise._settlePromise0 (/opt/t411-torznav/node_modules/request-promise/node_modules/bluebird/js/release/promise.js:612:10)
    at Promise._settlePromises (/opt/t411-torznav/node_modules/request-promise/node_modules/bluebird/js/release/promise.js:687:18)
    at Async._drainQueue (/opt/t411-torznav/node_modules/request-promise/node_modules/bluebird/js/release/async.js:133:16)
    at Async._drainQueues (/opt/t411-torznav/node_modules/request-promise/node_modules/bluebird/js/release/async.js:143:10)
    at Immediate.Async.drainQueues (/opt/t411-torznav/node_modules/request-promise/node_modules/bluebird/js/release/async.js:17:14)
    at runCallback (timers.js:649:20)
    at tryOnImmediate (timers.js:622:5)
    at processImmediate [as _immediateCallback] (timers.js:594:5)

The debug: undefined comes from the lines 212 I've uncommented.

Thanks!

foux commented 7 years ago

By digging a little farther, I get a 503 error on imdb.getReq({id: "tt"+context.req.query.imdbid},function(err,things) {

Perhaps we should have a fallback in case the IMDB API fails?

foux commented 7 years ago

@KiLMaN would it be possible to merge the Pull-Request?

KiLMaN commented 7 years ago

Done ;)