mirror of
https://github.com/TheBeastLT/torrentio-scraper.git
synced 2026-01-11 22:40:22 +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) {
|
||||
return controlTorrent(apiKey, seedingTorrent.id, 'stop_seeding');
|
||||
}
|
||||
if (torrents.filter(statusDownloading).pop()) {
|
||||
return controlTorrent(apiKey, seedingTorrent.id, 'delete');
|
||||
const downloadingTorrent = torrents.filter(statusDownloading).pop();
|
||||
if (downloadingTorrent) {
|
||||
return controlTorrent(apiKey, downloadingTorrent.id, 'delete');
|
||||
}
|
||||
return Promise.reject({ detail: 'No torrent to pause found' });
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue