last commit or the night, a feel-good one, now have search by file name and refimg tag, can find ppl :)

This commit is contained in:
2021-01-23 00:48:00 +11:00
parent c0648f0822
commit afc4eda233
2 changed files with 14 additions and 3 deletions

3
TODO
View File

@@ -1,4 +1,4 @@
### DB ## DB
NEW_FILE -> add, has_unidentified_face NEW_FILE -> add, has_unidentified_face
?has_face?, ?has_face?,
@@ -28,7 +28,6 @@
all images with faces, or if we 'reset face_flag' rescan all images all images with faces, or if we 'reset face_flag' rescan all images
### UI ### UI
* get basic search to work
### AI ### AI
* store reference images (UI allows this now) * store reference images (UI allows this now)

View File

@@ -21,7 +21,7 @@ import time
################################################################################ ################################################################################
from settings import Settings from settings import Settings
from job import Job, Joblog, NewJob from job import Job, Joblog, NewJob
from person import Person from person import Person, File_Person_Link
################################################################################ ################################################################################
# Class describing File in the database, and via sqlalchemy, connected to the DB as well # Class describing File in the database, and via sqlalchemy, connected to the DB as well
@@ -90,6 +90,18 @@ def file_list():
def files(): def files():
return render_template("files.html", page_title='View Files', entry_data=Entry.query.all()) return render_template("files.html", page_title='View Files', entry_data=Entry.query.all())
################################################################################
# /search -> show thumbnail view of files from import_path(s)
################################################################################
@app.route("/search", methods=["GET","POST"])
def search():
file_data=Entry.query.filter(Entry.name.ilike(f"%{request.form['term']}%")).all()
ai_data=Entry.query.join(File).join(File_Person_Link).filter(File_Person_Link.file_id==File.eid).join(Person).filter(Person.tag.ilike(f"%{request.form['term']}%")).all()
all_entries = file_data + ai_data
return render_template("files.html", page_title='View Files', entry_data=all_entries)
################################################################################ ################################################################################
# /files/scannow -> allows us to force a check for new files # /files/scannow -> allows us to force a check for new files
################################################################################ ################################################################################