diff --git a/backend/routes/dogs.py b/backend/routes/dogs.py index 9fb6b2c..9df065c 100644 --- a/backend/routes/dogs.py +++ b/backend/routes/dogs.py @@ -118,7 +118,9 @@ async def get_welcome_dashboard(dog_id: int, user=Depends(get_current_user)): ).fetchall() random_photo = None if photos: - chosen_url = _random.choice(photos)["url"] + import datetime as _dt2 + day_num = (_dt2.date.today() - _dt2.date(2024, 1, 1)).days + chosen_url = photos[day_num % len(photos)]["url"] random_photo = { "url": chosen_url, "preview_url": preview_url_from(chosen_url), diff --git a/backend/static/js/app.js b/backend/static/js/app.js index ec1212e..343d915 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 = '459'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen +const APP_VER = '460'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen const App = (() => { diff --git a/backend/static/js/pages/welcome.js b/backend/static/js/pages/welcome.js index 8b22aa4..6cac1f4 100644 --- a/backend/static/js/pages/welcome.js +++ b/backend/static/js/pages/welcome.js @@ -295,7 +295,7 @@ window.Page_welcome = (() => { const FEATURE_CARD_PAGES = new Set(FEATURE_CARDS.map(f => f.page)); function _heroHTML(dog, dashData) { - const photoUrl = dashData?.random_photo?.url || null; + const photoUrl = dashData?.random_photo?.preview_url || dashData?.random_photo?.url || null; const avatarUrl = dog?.foto_url || null; const dogName = dog ? UI.escape(dog.name) : 'Dein Hund'; const dogRasse = dog?.rasse ? UI.escape(dog.rasse) : ''; @@ -502,7 +502,7 @@ window.Page_welcome = (() => { function _updateHeroFromDash(dash, dog) { const heroBox = _container.querySelector('#wc-hero-box'); if (!heroBox) return; - const photoUrl = dash?.random_photo?.url; + const photoUrl = dash?.random_photo?.preview_url || dash?.random_photo?.url; const avatarUrl = dog?.foto_url; const dogName = dog ? UI.escape(dog.name) : 'Dein Hund'; const dogRasse = dog?.rasse ? UI.escape(dog.rasse) : ''; diff --git a/backend/static/sw.js b/backend/static/sw.js index a973334..8b752dc 100644 --- a/backend/static/sw.js +++ b/backend/static/sw.js @@ -3,7 +3,7 @@ Offline-Cache + Push Notifications + Tile-Cache ============================================================ */ -const CACHE_VERSION = 'by-v482'; +const CACHE_VERSION = 'by-v483'; const CACHE_STATIC = `${CACHE_VERSION}-static`; const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten