from flask import Blueprint, current_app, render_template from photoflow.core import Store bp = Blueprint("nav", __name__) def _store(): cfg = current_app.config["APP_CONFIG"] return Store(cfg.db_path).connect() @bp.route("/health") def health(): return "ok" @bp.route("/") def index(): s = _store() clusters = s.clusters_by_attention() stats = {"assets": len(s.all_assets()), "clusters": len(clusters), "pending": sum(1 for c in clusters if c.status == "pending")} s.close() return render_template("review.html", clusters=clusters, stats=stats)