feat: implement pause and resume functionality for game seeding in DownloadManager

This commit is contained in:
Hachi-R 2024-12-23 13:50:57 -03:00
parent ea90b49604
commit 843301c8b6
4 changed files with 29 additions and 2 deletions

View file

@ -148,6 +148,14 @@ def action():
downloader = downloads.get(game_id)
if downloader:
downloader.cancel_download()
elif action == 'resume_seeding':
torrent_downloader = TorrentDownloader(torrent_session)
downloads[game_id] = torrent_downloader
torrent_downloader.start_download(data['url'], data['save_path'], "")
elif action == 'pause_seeding':
downloader = downloads.get(game_id)
if downloader:
downloader.cancel_download()
else:
return jsonify({"error": "Invalid action"}), 400