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