feat: crete kill-torrent

This commit is contained in:
Zamitto 2024-07-03 12:06:26 -03:00
parent 75c8f69e81
commit 0f5db4f34e
5 changed files with 36 additions and 8 deletions

View file

@ -30,6 +30,15 @@ class Downloader:
self.torrent_handles[game_id] = None
self.downloading_game_id = -1
def cancel_all_downloads(self):
for game_id in self.torrent_handles:
torrent_handle = self.torrent_handles[game_id]
torrent_handle.pause()
self.session.remove_torrent(torrent_handle)
self.torrent_handles = {}
self.downloading_game_id = -1
def get_download_status(self):
if self.downloading_game_id == -1:
return None