Fix torrent deletion logic

This commit is contained in:
Maximilian Dorninger
2025-12-21 15:25:42 +01:00
committed by GitHub
parent e21e74a9ea
commit 2b21915b1f

View File

@@ -40,10 +40,11 @@ def delete_torrent(
torrent: torrent_dep,
delete_files: bool = False,
):
try:
service.cancel_download(torrent=torrent, delete_files=delete_files)
except RuntimeError:
pass
if delete_files:
try:
service.cancel_download(torrent=torrent, delete_files=False)
except RuntimeError:
pass
service.delete_torrent(torrent_id=torrent.id)