Documents no longer duplicated when indexing twice in a row. Thumbnails and documents erased when directory is removed

This commit is contained in:
simon987
2018-04-24 16:59:16 -04:00
parent 41f8294733
commit c1a59b7e9b
3 changed files with 14 additions and 8 deletions

4
run.py
View File

@@ -296,6 +296,10 @@ def directory_update_opt(dir_id):
@app.route("/directory/<int:dir_id>/del")
def directory_del(dir_id):
search.delete_directory(dir_id)
if os.path.exists("static/thumbnails/" + str(dir_id)):
shutil.rmtree("static/thumbnails/" + str(dir_id))
storage.remove_directory(dir_id)
flash("<strong>Deleted directory</strong>", "success")