mirror of
https://github.com/simon987/Simple-Incremental-Search-Tool.git
synced 2025-04-19 18:16:45 +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):
|
def execute_crawl(self, directory: Directory, counter: Value, done: Value):
|
||||||
|
|
||||||
|
Search("changeme").delete_directory(directory.id)
|
||||||
|
|
||||||
chksum_calcs = []
|
chksum_calcs = []
|
||||||
|
|
||||||
for arg in directory.get_option("CheckSumCalculators").split(","):
|
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")
|
@app.route("/directory/<int:dir_id>/del")
|
||||||
def directory_del(dir_id):
|
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)
|
storage.remove_directory(dir_id)
|
||||||
flash("<strong>Deleted directory</strong>", "success")
|
flash("<strong>Deleted directory</strong>", "success")
|
||||||
|
|
||||||
|
@ -276,15 +276,15 @@ function createDocCard(hit) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case "video":
|
case "video":
|
||||||
thumbnailOverlay = document.createElement("div");
|
|
||||||
thumbnailOverlay.setAttribute("class", "card-img-overlay");
|
|
||||||
|
|
||||||
//Duration
|
//Duration
|
||||||
let durationBadge = document.createElement("span");
|
if (hit["_source"].hasOwnProperty("duration")) {
|
||||||
durationBadge.setAttribute("class", "badge badge-resolution");
|
thumbnailOverlay = document.createElement("div");
|
||||||
durationBadge.appendChild(document.createTextNode(humanTime(hit["_source"]["duration"])));
|
thumbnailOverlay.setAttribute("class", "card-img-overlay");
|
||||||
thumbnailOverlay.appendChild(durationBadge);
|
let durationBadge = document.createElement("span");
|
||||||
|
durationBadge.setAttribute("class", "badge badge-resolution");
|
||||||
|
durationBadge.appendChild(document.createTextNode(humanTime(hit["_source"]["duration"])));
|
||||||
|
thumbnailOverlay.appendChild(durationBadge);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Tags
|
//Tags
|
||||||
|
Loading…
x
Reference in New Issue
Block a user