Fix: Tagesbild stabil (date-seeded statt random), preview_url für schnelleres Laden — SW by-v483, APP_VER 460

This commit is contained in:
rene 2026-04-29 10:02:39 +02:00
parent 117d32fcc3
commit 59feecb30b
4 changed files with 7 additions and 5 deletions

View file

@ -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),