[Core] Return Deferred from rename_files and rename_folder
core.rename_files and core.rename_folder now returns a Deferred that callbacks when rename is finished.
This commit is contained in:
parent
af6f2b2107
commit
b0b9180943
|
@ -783,7 +783,10 @@ class Core(component.Component):
|
|||
if torrent_id not in self.torrentmanager.torrents:
|
||||
raise InvalidTorrentError("torrent_id is not in session")
|
||||
|
||||
self.torrentmanager[torrent_id].rename_files(filenames)
|
||||
def rename():
|
||||
self.torrentmanager[torrent_id].rename_files(filenames)
|
||||
|
||||
return task.deferLater(reactor, 0, rename)
|
||||
|
||||
@export
|
||||
def rename_folder(self, torrent_id, folder, new_folder):
|
||||
|
@ -805,7 +808,7 @@ class Core(component.Component):
|
|||
if torrent_id not in self.torrentmanager.torrents:
|
||||
raise InvalidTorrentError("torrent_id is not in session")
|
||||
|
||||
self.torrentmanager[torrent_id].rename_folder(folder, new_folder)
|
||||
return self.torrentmanager[torrent_id].rename_folder(folder, new_folder)
|
||||
|
||||
@export
|
||||
def queue_top(self, torrent_ids):
|
||||
|
|
Loading…
Reference in New Issue