mirror of
https://github.com/knightcrawler-stremio/knightcrawler.git
synced 2024-12-20 03:29:51 +00:00
[addon] handle rd magnet error status
This commit is contained in:
@@ -132,6 +132,9 @@ async function _resolve(RD, infoHash, cachedEntryInfo, fileIndex) {
|
|||||||
} else if (torrent && statusDownloading(torrent.status)) {
|
} else if (torrent && statusDownloading(torrent.status)) {
|
||||||
console.log(`Downloading to RealDebrid ${infoHash} [${fileIndex}]...`);
|
console.log(`Downloading to RealDebrid ${infoHash} [${fileIndex}]...`);
|
||||||
return StaticResponse.DOWNLOADING;
|
return StaticResponse.DOWNLOADING;
|
||||||
|
} else if (torrent && statusMagnetError(torrent.status)) {
|
||||||
|
console.log(`Failed RealDebrid opening torrent ${infoHash} [${fileIndex}] due to magnet error`);
|
||||||
|
return StaticResponse.FAILED_OPENING;
|
||||||
} else if (torrent && (statusWaitingSelection(torrent.status) || statusOpening(torrent.status))) {
|
} else if (torrent && (statusWaitingSelection(torrent.status) || statusOpening(torrent.status))) {
|
||||||
console.log(`Trying to select files on RealDebrid ${infoHash} [${fileIndex}]...`);
|
console.log(`Trying to select files on RealDebrid ${infoHash} [${fileIndex}]...`);
|
||||||
return _selectTorrentFiles(RD, torrent)
|
return _selectTorrentFiles(RD, torrent)
|
||||||
@@ -252,6 +255,10 @@ function statusError(status) {
|
|||||||
return ['error', 'magnet_error', 'dead'].includes(status);
|
return ['error', 'magnet_error', 'dead'].includes(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function statusMagnetError(status) {
|
||||||
|
return status === 'magnet_error';
|
||||||
|
}
|
||||||
|
|
||||||
function statusOpening(status) {
|
function statusOpening(status) {
|
||||||
return status === 'magnet_conversion';
|
return status === 'magnet_conversion';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user