Fix: Tagesbild stabil (date-seeded statt random), preview_url für schnelleres Laden — SW by-v483, APP_VER 460
This commit is contained in:
parent
117d32fcc3
commit
59feecb30b
4 changed files with 7 additions and 5 deletions
|
|
@ -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),
|
||||
|
|
|
|||
|
|
@ -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 = (() => {
|
||||
|
||||
|
|
|
|||
|
|
@ -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) : '';
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue