Fix renaming folders when there is no trailing slash
This commit is contained in:
parent
4d65f237b1
commit
ad4e276a39
|
@ -817,6 +817,13 @@ class Torrent:
|
||||||
"""Renames a folder within a torrent. This basically does a file rename
|
"""Renames a folder within a torrent. This basically does a file rename
|
||||||
on all of the folders children."""
|
on all of the folders children."""
|
||||||
log.debug("attempting to rename folder: %s to %s", folder, new_folder)
|
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
|
||||||
|
|
||||||
|
if new_folder[-1:] != "/":
|
||||||
|
new_folder += "/"
|
||||||
|
|
||||||
for f in self.get_files():
|
for f in self.get_files():
|
||||||
if f["path"].startswith(folder):
|
if f["path"].startswith(folder):
|
||||||
# Keep a list of filerenames we're waiting on
|
# Keep a list of filerenames we're waiting on
|
||||||
|
|
Loading…
Reference in New Issue