mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-24 10:18:51 +00:00
fix to remove empty directory left from a removed torrent
This commit is contained in:
parent
9eeaded023
commit
f5e4990016
@ -314,7 +314,6 @@ class Manager:
|
|||||||
return self.sync() # Syncing will create a new torrent in the core, and return it's ID
|
return self.sync() # Syncing will create a new torrent in the core, and return it's ID
|
||||||
|
|
||||||
def remove_torrent(self, unique_ID, data_also):
|
def remove_torrent(self, unique_ID, data_also):
|
||||||
# Save some data before we remove the torrent, needed later in this func
|
|
||||||
temp = self.unique_IDs[unique_ID]
|
temp = self.unique_IDs[unique_ID]
|
||||||
temp_fileinfo = deluge_core.get_file_info(unique_ID)
|
temp_fileinfo = deluge_core.get_file_info(unique_ID)
|
||||||
|
|
||||||
@ -331,6 +330,8 @@ class Manager:
|
|||||||
os.remove(os.path.join(temp.save_dir, filename))
|
os.remove(os.path.join(temp.save_dir, filename))
|
||||||
except OSError:
|
except OSError:
|
||||||
pass # No file just means it wasn't downloaded, we can continue
|
pass # No file just means it wasn't downloaded, we can continue
|
||||||
|
#clean up empty dir
|
||||||
|
os.rmdir(os.path.dirname(os.path.join(temp.save_dir, filename)))
|
||||||
|
|
||||||
# A function to try and reload a torrent from a previous session. This is
|
# A function to try and reload a torrent from a previous session. This is
|
||||||
# used in the event that Deluge crashes and a blank state is loaded.
|
# used in the event that Deluge crashes and a blank state is loaded.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user