From f5e499001677ef56bd3b95e4b7255ae22af89c42 Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Fri, 1 Jun 2007 12:09:15 +0000 Subject: [PATCH] fix to remove empty directory left from a removed torrent --- src/core.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core.py b/src/core.py index e58b41a31..d7d858715 100644 --- a/src/core.py +++ b/src/core.py @@ -314,7 +314,6 @@ class Manager: 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): - # Save some data before we remove the torrent, needed later in this func temp = self.unique_IDs[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)) except OSError: 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 # used in the event that Deluge crashes and a blank state is loaded.