Skip to content

Commit

Permalink
fix TB free free active item logic
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBeastLT committed Nov 29, 2024
1 parent 01f5ebd commit 8c346ff
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion addon/moch/torbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ async function freeLastActiveTorrent(apiKey) {
if (seedingTorrent) {
return controlTorrent(apiKey, seedingTorrent.id, 'stop_seeding');
}
if (torrents.filter(statusDownloading).pop()) {
const downloadingTorrent = torrents.filter(statusDownloading).pop();
if (downloadingTorrent) {
return controlTorrent(apiKey, seedingTorrent.id, 'delete');
}
return Promise.reject({ detail: 'No torrent to pause found' });
Expand Down

0 comments on commit 8c346ff

Please sign in to comment.