mirror of
https://github.com/simon987/Simple-Incremental-Search-Tool.git
synced 2025-04-10 14:06:41 +00:00
Documents no longer duplicated when indexing twice in a row. Thumbnails and documents erased when directory is removed
This commit is contained in:
parent
41f8294733
commit
c1a59b7e9b
@ -124,6 +124,8 @@ class TaskManager:
|
||||
|
||||
def execute_crawl(self, directory: Directory, counter: Value, done: Value):
|
||||
|
||||
Search("changeme").delete_directory(directory.id)
|
||||
|
||||
chksum_calcs = []
|
||||
|
||||
for arg in directory.get_option("CheckSumCalculators").split(","):
|
||||
|
4
run.py
4
run.py
@ -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")
|
||||
|
||||
|
@ -276,15 +276,15 @@ function createDocCard(hit) {
|
||||
break;
|
||||
|
||||
case "video":
|
||||
thumbnailOverlay = document.createElement("div");
|
||||
thumbnailOverlay.setAttribute("class", "card-img-overlay");
|
||||
|
||||
//Duration
|
||||
let durationBadge = document.createElement("span");
|
||||
durationBadge.setAttribute("class", "badge badge-resolution");
|
||||
durationBadge.appendChild(document.createTextNode(humanTime(hit["_source"]["duration"])));
|
||||
thumbnailOverlay.appendChild(durationBadge);
|
||||
|
||||
if (hit["_source"].hasOwnProperty("duration")) {
|
||||
thumbnailOverlay = document.createElement("div");
|
||||
thumbnailOverlay.setAttribute("class", "card-img-overlay");
|
||||
let durationBadge = document.createElement("span");
|
||||
durationBadge.setAttribute("class", "badge badge-resolution");
|
||||
durationBadge.appendChild(document.createTextNode(humanTime(hit["_source"]["duration"])));
|
||||
thumbnailOverlay.appendChild(durationBadge);
|
||||
}
|
||||
}
|
||||
|
||||
//Tags
|
||||
|
Loading…
x
Reference in New Issue
Block a user