This commit is contained in:
mike
2026-06-27 20:23:14 +02:00
parent 35306327f7
commit 52ae51fef3
7 changed files with 4493 additions and 134 deletions

View File

@@ -227,9 +227,14 @@ def update_car_html():
return
try:
# Use database to list only non-archived images
persons = database.list_persons(include_archived=False)
db_images = {p[0] for p in persons}
# List images in output_dir
extensions = ('.jpg', '.jpeg', '.png', '.gif', '.webp', '.bmp', '.svg')
images = [f for f in os.listdir(output_dir) if f.lower().endswith(extensions) and f != "car.html"]
images = [f for f in os.listdir(output_dir)
if f.lower().endswith(extensions) and f != "car.html" and f in db_images]
# Sort by mtime, newest first
images.sort(key=lambda x: os.path.getmtime(os.path.join(output_dir, x)), reverse=True)