Luca448 commited on
Commit
e0b5eec
·
1 Parent(s): 8ed769b

Fix: Retroactively enrich old vocabulary cards lacking explanations, fix Gemini model name

Browse files
Files changed (2) hide show
  1. index.html +1 -1
  2. src/app.js +5 -2
index.html CHANGED
@@ -74,7 +74,7 @@
74
  </head>
75
  <body class="dark-theme in-chat-view" style="visibility: hidden;">
76
 
77
- <div id="live-version-badge" style="position: fixed; top: 50px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--text-secondary); opacity: 0.6; z-index: 99999; pointer-events: none; font-weight: 500; font-family: monospace; letter-spacing: 1px; background: rgba(0,0,0,0.2); padding: 2px 8px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.05);">BUILD 1.8.316</div>
78
 
79
  <!-- SVG Filters for Liquid Glass Refraction -->
80
  <svg width="0" height="0" style="position: absolute; pointer-events: none;">
 
74
  </head>
75
  <body class="dark-theme in-chat-view" style="visibility: hidden;">
76
 
77
+ <div id="live-version-badge" style="position: fixed; top: 50px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--text-secondary); opacity: 0.6; z-index: 99999; pointer-events: none; font-weight: 500; font-family: monospace; letter-spacing: 1px; background: rgba(0,0,0,0.2); padding: 2px 8px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.05);">BUILD 1.8.317</div>
78
 
79
  <!-- SVG Filters for Liquid Glass Refraction -->
80
  <svg width="0" height="0" style="position: absolute; pointer-events: none;">
src/app.js CHANGED
@@ -370,7 +370,10 @@ Zu übersetzen: "${word}"`;
370
  if (!schnelldeck) return;
371
 
372
  const cards = db.getCardsForDeck(schnelldeck.id);
373
- const cardsToEnrich = cards.filter(c => c.back.includes('<!-- NEEDS_ENRICHMENT -->'));
 
 
 
374
 
375
  if (cardsToEnrich.length > 0) {
376
  console.log(`Found ${cardsToEnrich.length} cards needing AI enrichment...`);
@@ -401,7 +404,7 @@ Beispiel für Tippfehler bei "abanden":
401
  {"correctedWord": "abandon", "explanation": "Jemanden oder etwas <b>verlassen</b> oder aufgeben.", "example": "Er musste das alte Auto <b>verlassen</b>.", "imageQuery": "abandoned old car single photo clear focus"}`;
402
 
403
  const response = await aiRouter.sendMessage(prompt, {
404
- model: 'gemini-3.1-flash-lite' // User requested fast model for this
405
  });
406
 
407
  let jsonStr = response.trim();
 
370
  if (!schnelldeck) return;
371
 
372
  const cards = db.getCardsForDeck(schnelldeck.id);
373
+ const cardsToEnrich = cards.filter(c =>
374
+ c.back.includes('<!-- NEEDS_ENRICHMENT -->') ||
375
+ (!c.back.includes('**Erklärung:**') && !c.back.includes('Erklärung:'))
376
+ );
377
 
378
  if (cardsToEnrich.length > 0) {
379
  console.log(`Found ${cardsToEnrich.length} cards needing AI enrichment...`);
 
404
  {"correctedWord": "abandon", "explanation": "Jemanden oder etwas <b>verlassen</b> oder aufgeben.", "example": "Er musste das alte Auto <b>verlassen</b>.", "imageQuery": "abandoned old car single photo clear focus"}`;
405
 
406
  const response = await aiRouter.sendMessage(prompt, {
407
+ model: 'gemini-1.5-flash' // Fast and reliable fallback
408
  });
409
 
410
  let jsonStr = response.trim();