mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-20 19:44:52 +00:00
[Core] Allow renaming torrent to empty string to remove the folder
This commit is contained in:
parent
887afa9389
commit
af6f2b2107
1 changed files with 3 additions and 4 deletions
|
@ -1290,11 +1290,10 @@ class Torrent(object):
|
|||
twisted.internet.defer.Deferred: A deferred which fires when the rename is complete
|
||||
"""
|
||||
log.debug("Attempting to rename folder: %s to %s", folder, new_folder)
|
||||
if len(new_folder) < 1:
|
||||
log.error("Attempting to rename a folder with an invalid folder name: %s", new_folder)
|
||||
return
|
||||
|
||||
new_folder = sanitize_filepath(new_folder, folder=True)
|
||||
# Empty string means remove the dir and move its content to the parent
|
||||
if len(new_folder) > 0:
|
||||
new_folder = sanitize_filepath(new_folder, folder=True)
|
||||
|
||||
def on_file_rename_complete(dummy_result, wait_dict, index):
|
||||
"""File rename complete"""
|
||||
|
|
Loading…
Add table
Reference in a new issue