Merge pull request #301 from maxdorninger/maxdorninger-fix-torrent-deletion

Fix torrent deletion logic
This commit is contained in:
Maximilian Dorninger
2025-12-21 16:19:31 +01:00
committed by GitHub

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)