mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-24 02:11:06 +00:00
Updates for rename_folder
This commit is contained in:
parent
a555fecc18
commit
41bedda10a
@ -806,9 +806,10 @@ class Torrent:
|
||||
def rename_folder(self, folder, new_folder):
|
||||
"""Renames a folder within a torrent. This basically does a file rename
|
||||
on all of the folders children."""
|
||||
log.debug("attempting to rename folder: %s to %s", folder, new_folder)
|
||||
for f in self.get_files():
|
||||
if f["path"].startswith(folder):
|
||||
# Keep a list of filerenames we're waiting on
|
||||
self.waiting_on_folder_rename.append(f["index"])
|
||||
self.handle.rename_file(f["index"], f["path"].replace(folder, new_folder, 1))
|
||||
|
||||
|
||||
|
@ -170,7 +170,8 @@ class BaseClient(object):
|
||||
"set_torrent_stop_ratio", "set_torrent_stop_at_ratio",
|
||||
"set_torrent_remove_at_ratio", "set_torrent_move_on_completed",
|
||||
"set_torrent_move_on_completed_path", "add_torrent_magnets",
|
||||
"create_torrent", "upload_plugin", "rescan_plugins", "rename_files"]
|
||||
"create_torrent", "upload_plugin", "rescan_plugins", "rename_files",
|
||||
"rename_folder"]
|
||||
|
||||
def __init__(self):
|
||||
self.core = _core
|
||||
|
Loading…
x
Reference in New Issue
Block a user