feat: apply suggestions

This commit is contained in:
Zamitto 2024-07-03 16:10:23 -03:00
parent ae3daa4c79
commit 153291f89f
10 changed files with 32 additions and 30 deletions

View file

@ -30,12 +30,13 @@ class Downloader:
self.torrent_handles[game_id] = None
self.downloading_game_id = -1
def cancel_all_downloads(self):
def abort_session(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.session.abort()
self.torrent_handles = {}
self.downloading_game_id = -1