move files;cleanup empty folders
This commit is contained in:
parent
4b5fedb7a8
commit
173fde1d1b
2 changed files with 7 additions and 0 deletions
|
|
@ -618,6 +618,8 @@ class File(db.Model):
|
|||
shutil.move(current_path, path)
|
||||
self.path = new_path
|
||||
self.save()
|
||||
for folder in set(os.path.dirname(p) for p in [current_path, path]):
|
||||
remove_empty_folders(folder)
|
||||
|
||||
def save(self):
|
||||
state.db.session.add(self)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue