check offcloud status of torrent as info from history has inconsistent data

This commit is contained in:
TheBeastLT
2023-12-16 14:37:11 +02:00
parent bdf05a12ea
commit 66988c6604
3 changed files with 8 additions and 6 deletions

View File

@@ -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)) {

View File

@@ -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"
}

View File

@@ -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",