diff --git a/backend/main.py b/backend/main.py index f1025de..533923e 100644 --- a/backend/main.py +++ b/backend/main.py @@ -406,7 +406,7 @@ async def serve_media(path: str, request: _Request): raise _HE(404, "Nicht gefunden.") return _media_response(filepath) -APP_VER = "961" # muss mit APP_VER in app.js übereinstimmen +APP_VER = "962" # muss mit APP_VER in app.js übereinstimmen @app.get("/.well-known/assetlinks.json") async def assetlinks(): diff --git a/backend/routes/stats.py b/backend/routes/stats.py index 49fe778..cfaecca 100644 --- a/backend/routes/stats.py +++ b/backend/routes/stats.py @@ -30,19 +30,23 @@ async def public_stats(): if _pub_cache["data"] and now - _pub_cache["ts"] < _PUB_TTL: return _pub_cache["data"] with db() as conn: - users = conn.execute("SELECT COUNT(*) FROM users").fetchone()[0] - dogs = conn.execute("SELECT COUNT(*) FROM dogs").fetchone()[0] - km = conn.execute( + users = conn.execute("SELECT COUNT(*) FROM users").fetchone()[0] + dogs = conn.execute("SELECT COUNT(*) FROM dogs").fetchone()[0] + km = conn.execute( "SELECT ROUND(COALESCE(SUM(distanz_km),0),0) FROM routes" ).fetchone()[0] - posts = conn.execute("SELECT COUNT(*) FROM forum_posts").fetchone()[0] - diary = conn.execute("SELECT COUNT(*) FROM diary").fetchone()[0] + posts = conn.execute("SELECT COUNT(*) FROM forum_posts").fetchone()[0] + diary = conn.execute("SELECT COUNT(*) FROM diary").fetchone()[0] + kotbeutel = conn.execute( + "SELECT COUNT(*) FROM user_map_pois WHERE type='kotbeutel'" + ).fetchone()[0] data = { "users": users, "dogs": dogs, "km": int(km or 0), "forum_posts": posts, "diary_entries": diary, + "kotbeutel": kotbeutel, } _pub_cache["data"] = data _pub_cache["ts"] = now diff --git a/backend/static/js/app.js b/backend/static/js/app.js index 6594b45..f630663 100644 --- a/backend/static/js/app.js +++ b/backend/static/js/app.js @@ -3,7 +3,7 @@ Router, State-Management, Navigation, Initialisierung. ============================================================ */ -const APP_VER = '961'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen +const APP_VER = '962'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen const APP_VERSION = '1.5.1'; // ← semantische Version, wird bei make release gesetzt const IS_STAGING = location.hostname === 'staging.banyaro.app'; // Cache-Bust-Parameter nach Update-Reload sofort entfernen diff --git a/backend/static/js/worlds.js b/backend/static/js/worlds.js index b250a29..ca5fdce 100644 --- a/backend/static/js/worlds.js +++ b/backend/static/js/worlds.js @@ -1342,8 +1342,9 @@ window.Worlds = (() => { if (mmdd === `${mt}-${dt}`) return 'tomorrow'; return null; } - const bday = _birthdayState(dog.geburtstag); - const bdayYear = dog.geburtstag ? new Date().getFullYear() - parseInt(dog.geburtstag.slice(0, 4)) : null; + const bdayDog = _dogs.find(d => _birthdayState(d.geburtstag)) || null; + const bday = bdayDog ? _birthdayState(bdayDog.geburtstag) : null; + const bdayYear = bdayDog?.geburtstag ? new Date().getFullYear() - parseInt(bdayDog.geburtstag.slice(0, 4)) : null; const [streakRes, diaryRes] = await Promise.allSettled([ _cachedGet(`streak_${dog.id}`, `/streak/${dog.id}`), @@ -1428,8 +1429,8 @@ window.Worlds = (() => {