fix: mtime index dans processed_full, print 404, galerie full-width
🚀 Deploy — JH Photomaton / 🔍 Vérification (push) Has been cancelled
🚀 Deploy — JH Photomaton / 🍓 Deploy sur le Pi (push) Has been cancelled

This commit is contained in:
2026-07-17 16:29:06 +02:00
parent 11bd91c386
commit 4592f20be3
3 changed files with 58 additions and 38 deletions
+14 -10
View File
@@ -50,20 +50,24 @@ async def api_gallery_photos(
if ev:
started_at = ev["started_at"] or 0.0
ended_at = ev["ended_at"] or datetime.now().timestamp()
# Construire un index mtime par stem ET par nom complet
# Construire un index mtime : cherche dans media_dir et ses sous-dossiers connus
mtime_index: dict[str, float] = {}
for media_dir_candidate in [
Path(cfg.photobooth.media_dir),
base = Path(cfg.photobooth.media_dir)
checked: set = set()
for candidate in [
base,
base / "processed_full",
Path("/home/pi/photobooth-data/media/processed_full"),
Path("/home/pi/photobooth-data/media"),
]:
if media_dir_candidate.exists():
for f in media_dir_candidate.iterdir():
if f.is_file():
mt = f.stat().st_mtime
mtime_index[f.name] = mt # uuid.jpg
mtime_index[f.stem] = mt # uuid
break
if not candidate.exists() or candidate in checked:
continue
checked.add(candidate)
for f in candidate.iterdir():
if f.is_file() and f.suffix.lower() in (".jpg", ".jpeg", ".png"):
mt = f.stat().st_mtime
mtime_index[f.name] = mt
mtime_index[f.stem] = mt
def _in_event(p: dict) -> bool:
pid = _get_id(p)