Pflege: Fell schneiden vs. trimmen + Tagebuch Medien-Button nach oben

- dogs.py: Pflegeart-Filter (trimmen/schneiden) anhand Rassen-Beschreibung
- dog-profile.js: Badge '✂️ Schneiden' / ' Trimmen' bei Fell-Kategorie
- diary.js: Fotos/Videos-Button direkt nach Textfeld (vor Ort und Meilenstein)
- ki.py: Standardmodell auf claude-sonnet-4-6 umgestellt
This commit is contained in:
rene 2026-04-25 08:21:49 +02:00
parent 69f78219ae
commit 22225d5717
3 changed files with 49 additions and 27 deletions

View file

@ -361,8 +361,9 @@ async def get_pflege_tipps(dog_id: int, user=Depends(get_current_user)):
(f"%{dog['rasse']}%",)
).fetchone()
# Fell-Typ ableiten
# Fell-Typ und Pflegeart ableiten
fell_filter = None
fell_pflege_art_filter = None
if rasse_info:
beschr = (rasse_info["beschreibung"] or "").lower()
if any(w in beschr for w in ["lockig", "wellig", "kraus", "pudel", "doodle"]):
@ -374,6 +375,12 @@ async def get_pflege_tipps(dog_id: int, user=Depends(get_current_user)):
elif rasse_info["groesse"] in ("gross", "sehr_gross"):
fell_filter = "doppel"
# Pflegeart: Trimmen vs. Schneiden
if any(w in beschr for w in ["trimm", "hand-stripping", "stripping", "rauhhaar", "drahthaar", "rauhaar"]):
fell_pflege_art_filter = "trimmen"
elif any(w in beschr for w in ["schneid", "geschoren", "schere", "clipper"]):
fell_pflege_art_filter = "schneiden"
with db() as conn:
alle_tipps = conn.execute(
"SELECT * FROM pflege_tipps ORDER BY kategorie, titel"
@ -388,10 +395,15 @@ async def get_pflege_tipps(dog_id: int, user=Depends(get_current_user)):
result = []
for t in alle_tipps:
t = dict(t)
# Fell-Filter
# Fell-Typ-Filter
if fell_filter and t["fell_typ"] and t["fell_typ"] != "alle":
if fell_filter not in t["fell_typ"].split(","):
continue
# Pflegeart-Filter: Trimm-Tipps nicht bei Schneidehunden und umgekehrt
tipp_art = t.get("fell_pflege_art")
if tipp_art and tipp_art != "alle" and fell_pflege_art_filter:
if tipp_art != fell_pflege_art_filter:
continue
t["schritte"] = _json.loads(t["schritte"] or "[]")
t["saisonal_aktuell"] = bool(t["saison"] and heute_saison in t["saison"])
result.append(t)
@ -403,9 +415,10 @@ async def get_pflege_tipps(dog_id: int, user=Depends(get_current_user)):
tipp_des_tages = (saisonal or result)[day_hash % len(saisonal or result)] if result else None
return {
"dog_name": dog["name"],
"rasse_name": rasse_info["name"] if rasse_info else dog["rasse"],
"tipp_des_tages": tipp_des_tages,
"tipps": result,
"kategorien": list(dict.fromkeys(t["kategorie"] for t in result)),
"dog_name": dog["name"],
"rasse_name": rasse_info["name"] if rasse_info else dog["rasse"],
"tipp_des_tages": tipp_des_tages,
"tipps": result,
"kategorien": list(dict.fromkeys(t["kategorie"] for t in result)),
"fell_pflege_art": fell_pflege_art_filter, # 'schneiden' | 'trimmen' | None
}