diff --git a/addon/moch/offcloud.js b/addon/moch/offcloud.js index 8010f65..239af42 100644 --- a/addon/moch/offcloud.js +++ b/addon/moch/offcloud.js @@ -91,7 +91,9 @@ export async function resolve({ ip, apiKey, infoHash, cachedEntryInfo, fileIndex } async function _resolve(OC, infoHash, cachedEntryInfo, fileIndex) { - const torrent = await _createOrFindTorrent(OC, infoHash); + const torrent = await _createOrFindTorrent(OC, infoHash) + .then(info => info.requestId ? OC.cloud.status(info.requestId) : Promise.resolve(info)) + .then(info => info.status || info); if (torrent && statusReady(torrent)) { return _unrestrictLink(OC, infoHash, torrent, cachedEntryInfo, fileIndex); } else if (torrent && statusDownloading(torrent)) { diff --git a/addon/package-lock.json b/addon/package-lock.json index 19cf8f3..7b5fe2c 100644 --- a/addon/package-lock.json +++ b/addon/package-lock.json @@ -21,7 +21,7 @@ "magnet-uri": "^6.2.0", "name-to-imdb": "^3.0.4", "named-queue": "^2.2.1", - "offcloud-api": "^1.0.1", + "offcloud-api": "^1.0.2", "parse-torrent-title": "git://github.com/TheBeastLT/parse-torrent-title.git#022408972c2a040f846331a912a6a8487746a654", "pg": "^8.10.0", "premiumize-api": "^1.0.3", @@ -1369,9 +1369,9 @@ } }, "node_modules/offcloud-api": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/offcloud-api/-/offcloud-api-1.0.1.tgz", - "integrity": "sha512-O49iJRy4ein/VcaINw+3wSVWonEd4BEBCLbgD/fyxIHPf7eW1CSYnyEdrm6+E1k/lMlpTcvx7yk/hvh1iLfoOg==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/offcloud-api/-/offcloud-api-1.0.2.tgz", + "integrity": "sha512-KOxDX+QIUcI/JEwoXoRGK7P+RygSsmCOta/6bEtKeBMc9CDEnb9xgGNDjDFYCxm6U8rvaOhF9NA02i3EisH9Pw==", "dependencies": { "request": "^2.83.0" } diff --git a/addon/package.json b/addon/package.json index e201962..164e389 100644 --- a/addon/package.json +++ b/addon/package.json @@ -21,7 +21,7 @@ "magnet-uri": "^6.2.0", "name-to-imdb": "^3.0.4", "named-queue": "^2.2.1", - "offcloud-api": "^1.0.1", + "offcloud-api": "^1.0.2", "parse-torrent-title": "git://github.com/TheBeastLT/parse-torrent-title.git#022408972c2a040f846331a912a6a8487746a654", "pg": "^8.10.0", "premiumize-api": "^1.0.3",