fix file deletion when seeding

This commit is contained in:
2026-03-07 21:56:07 +01:00
parent bd5ccc7688
commit eccdb2f068
+2 -2
View File
@@ -881,15 +881,15 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
if download_path and os.path.exists(download_path): if download_path and os.path.exists(download_path):
try: try:
if os.path.isfile(download_path): if os.path.isfile(download_path):
remove_download_log(magnet_link)
os.remove(download_path) os.remove(download_path)
del state.active_downloads[magnet_link] del state.active_downloads[magnet_link]
remove_download_log(magnet_link)
consoleLog(f"Deleted files for: {magnetdl.status().name}", True) consoleLog(f"Deleted files for: {magnetdl.status().name}", True)
else: else:
import shutil import shutil
shutil.rmtree(download_path)
del state.active_downloads[magnet_link] del state.active_downloads[magnet_link]
remove_download_log(magnet_link) remove_download_log(magnet_link)
shutil.rmtree(download_path)
consoleLog(f"Deleted files for: {magnetdl.status().name}", True) consoleLog(f"Deleted files for: {magnetdl.status().name}", True)
except Exception as e: except Exception as e:
consoleLog(f"Error deleting files: {e}", True) consoleLog(f"Error deleting files: {e}", True)