fixed 2 x TODOs, can now add an existing face as a refimg, and I sped up the recent jobs page

This commit is contained in:
2025-08-19 20:53:26 +10:00
parent fa63e08b59
commit 1831c49b15
2 changed files with 3 additions and 10 deletions

9
TODO
View File

@@ -1,13 +1,4 @@
### GENERAL ### GENERAL
* recent jobs is slow, think its this 'sql':
jobs = Job.query.filter( Job.last_update >= (func.now() - func.cast(concat(settings.job_archive_age, 'DAYS'), INTERVAL)) ).order_by(Job.id.desc()).all()
I'm guessing remove the funcs and make the sql just grab last 50 or something simpler
* add a reference image from existing image, or even "replace? ref image with this one" <- new menu option
- started on this in both jscript and python
-- believe I should definitively add person id to jscript (so thats in files)
-- then pass that through the context menut to the route and update the DB
* rm dups job should show progress bar * rm dups job should show progress bar
* in viewer, there is no move button (maybe add one?) * in viewer, there is no move button (maybe add one?)
* consider doing duplicates before AI, and if there are say 100s+, then maybe pause the AI work * consider doing duplicates before AI, and if there are say 100s+, then maybe pause the AI work

4
job.py
View File

@@ -171,7 +171,9 @@ def jobs():
jobs = Job.query.order_by(Job.id.desc()).all() jobs = Job.query.order_by(Job.id.desc()).all()
else: else:
page_title='Job list (recent)' page_title='Job list (recent)'
jobs = Job.query.filter( Job.last_update >= (func.now() - func.cast(concat(settings.job_archive_age, 'DAYS'), INTERVAL)) ).order_by(Job.id.desc()).all() # work out cutoff in python (used to do this in sql and it was too slow)
cutoff = datetime.now() - timedelta(days=settings.job_archive_age)
jobs = Job.query.filter( Job.last_update >= cutoff ).order_by(Job.id.desc()).all()
return render_template("jobs.html", jobs=jobs, page_title=page_title) return render_template("jobs.html", jobs=jobs, page_title=page_title)