mirror of
https://github.com/TheBeastLT/torrentio-scraper.git
synced 2026-05-18 10:51:45 +00:00
fix TB free free active item logic
This commit is contained in:
parent
01f5ebd90f
commit
d8ddec1638
1 changed files with 3 additions and 2 deletions
|
|
@ -151,8 +151,9 @@ async function freeLastActiveTorrent(apiKey) {
|
||||||
if (seedingTorrent) {
|
if (seedingTorrent) {
|
||||||
return controlTorrent(apiKey, seedingTorrent.id, 'stop_seeding');
|
return controlTorrent(apiKey, seedingTorrent.id, 'stop_seeding');
|
||||||
}
|
}
|
||||||
if (torrents.filter(statusDownloading).pop()) {
|
const downloadingTorrent = torrents.filter(statusDownloading).pop();
|
||||||
return controlTorrent(apiKey, seedingTorrent.id, 'delete');
|
if (downloadingTorrent) {
|
||||||
|
return controlTorrent(apiKey, downloadingTorrent.id, 'delete');
|
||||||
}
|
}
|
||||||
return Promise.reject({ detail: 'No torrent to pause found' });
|
return Promise.reject({ detail: 'No torrent to pause found' });
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue