diff --git a/backend/src/tools/koepi/routes.js b/backend/src/tools/koepi/routes.js index be07738..913ed37 100644 --- a/backend/src/tools/koepi/routes.js +++ b/backend/src/tools/koepi/routes.js @@ -396,12 +396,12 @@ function hasQty(desc, count, vol) { // Bild pro Angebot exakt nach Mengenangabe wählen (siehe Vorgabe): // 20x0,5 -> kasten_050 | 20x0,33 -> kasten_steini | 24x0,33 -> kasten_033 // 11x0,5 -> kasten_11er | 6x0,33 -> traeger | 24x0,5 -> palette_050 -// 20x0,5 UND 24x0,33 gleichzeitig -> kasten_033_055 | sonst -> koepi_platzhalter +// 20x0,5 UND 24x0,33 gleichzeitig -> kasten_033_05 | sonst -> koepi_platzhalter function pickOfferImage(description) { const d = (description || '').toLowerCase(); const q2005 = hasQty(d, 20, '0,5'); const q2433 = hasQty(d, 24, '0,33'); - if (q2005 && q2433) return '/koepi/kasten_033_055.png'; + if (q2005 && q2433) return '/koepi/kasten_033_05.png'; if (hasQty(d, 20, '0,33')) return '/koepi/kasten_steini.png'; if (q2433) return '/koepi/kasten_033.png'; if (hasQty(d, 11, '0,5')) return '/koepi/kasten_11er.png'; @@ -560,7 +560,12 @@ async function scrapeProspekte() { } // "Sondermagazin"-Prospekte ausblenden (keine normalen Wochenangebote) - const withoutSondermagazin = all.filter(b => !(b.title || '').toLowerCase().includes('sondermagazin')); + // Unerwünschte Prospekt-Typen ausblenden (Sondermagazine, Reise-Prospekte etc.) + const EXCLUDED_TITLE_KEYWORDS = ['sondermagazin', 'reisen']; + const withoutSondermagazin = all.filter(b => { + const t = (b.title || '').toLowerCase(); + return !EXCLUDED_TITLE_KEYWORDS.some(kw => t.includes(kw)); + }); const targeted = withoutSondermagazin.filter(b => b.isTarget); // Chronologisch in "aktuell laufend" und "kommend" trennen diff --git a/frontend/public/koepi/aldi.png b/frontend/public/koepi/aldi.png new file mode 100644 index 0000000..0d7ee38 Binary files /dev/null and b/frontend/public/koepi/aldi.png differ diff --git a/frontend/public/koepi/edeka.png b/frontend/public/koepi/edeka.png new file mode 100644 index 0000000..18a05dd Binary files /dev/null and b/frontend/public/koepi/edeka.png differ diff --git a/frontend/public/koepi/hornbach.png b/frontend/public/koepi/hornbach.png new file mode 100644 index 0000000..f1c24b9 Binary files /dev/null and b/frontend/public/koepi/hornbach.png differ diff --git a/frontend/public/koepi/kaufland.png b/frontend/public/koepi/kaufland.png new file mode 100644 index 0000000..1fb2efa Binary files /dev/null and b/frontend/public/koepi/kaufland.png differ diff --git a/frontend/public/koepi/lidl.png b/frontend/public/koepi/lidl.png new file mode 100644 index 0000000..b2d5403 Binary files /dev/null and b/frontend/public/koepi/lidl.png differ diff --git a/frontend/public/koepi/netto.png b/frontend/public/koepi/netto.png new file mode 100644 index 0000000..9a2f2cc Binary files /dev/null and b/frontend/public/koepi/netto.png differ diff --git a/frontend/public/koepi/netto_getraenkemarkt.png b/frontend/public/koepi/netto_getraenkemarkt.png new file mode 100644 index 0000000..c3e4243 Binary files /dev/null and b/frontend/public/koepi/netto_getraenkemarkt.png differ diff --git a/frontend/public/koepi/penny.png b/frontend/public/koepi/penny.png new file mode 100644 index 0000000..18d1d6b Binary files /dev/null and b/frontend/public/koepi/penny.png differ diff --git a/frontend/public/koepi/rewe.png b/frontend/public/koepi/rewe.png new file mode 100644 index 0000000..b859df4 Binary files /dev/null and b/frontend/public/koepi/rewe.png differ diff --git a/frontend/public/koepi/trinkgut.png b/frontend/public/koepi/trinkgut.png new file mode 100644 index 0000000..4faf727 Binary files /dev/null and b/frontend/public/koepi/trinkgut.png differ diff --git a/frontend/src/tools/koepi.jsx b/frontend/src/tools/koepi.jsx index 647cce8..f9057eb 100644 --- a/frontend/src/tools/koepi.jsx +++ b/frontend/src/tools/koepi.jsx @@ -19,6 +19,25 @@ function publisherColor(name) { return '#888'; } +// Logo-Bild je Händler — Reihenfolge wichtig: "Netto Getränke-Discount" muss +// VOR dem generischen "netto"-Check geprüft werden. Kein Eintrag (z.B. +// Kaufland) -> Aufrufer fällt auf den farbigen Text-Badge zurück. +function retailerLogo(name) { + if (!name) return null; + const n = name.toLowerCase(); + if (n.includes('netto') && n.includes('getränke')) return '/koepi/netto_getraenkemarkt.png'; + if (n.includes('netto')) return '/koepi/netto.png'; + if (n.includes('rewe dortmund')) return null; + if (n.includes('rewe')) return '/koepi/rewe.png'; + if (n.includes('edeka') || n.includes('e center')) return '/koepi/edeka.png'; + if (n.includes('trinkgut')) return '/koepi/trinkgut.png'; + if (n.includes('penny')) return '/koepi/penny.png'; + if (n.includes('lidl')) return '/koepi/lidl.png'; + if (n.includes('aldi')) return '/koepi/aldi.png'; + if (n.includes('hornbach')) return '/koepi/hornbach.png'; + return null; +} + function fmtDate(str) { if (!str) return null; try { return new Date(str).toLocaleDateString('de-DE', { day:'2-digit', month:'2-digit', year:'numeric' }); } @@ -28,6 +47,7 @@ function fmtDate(str) { // ── Angebots-Karte (marktguru) ──────────────────────────────────────────────── function OfferCard({ offer }) { const color = publisherColor(offer.retailer); + const logo = retailerLogo(offer.retailer); return (
- {offer.retailer} + {logo ? ( + {offer.retailer} + ) : ( + {offer.retailer} + )} {offer.oldPrice && -29%}
{offer.address && ( @@ -97,6 +121,7 @@ function OfferCard({ offer }) { // ── Prospekt-Karte (marktguru) ──────────────────────────────────────────────── function ProspektCard({ b }) { const color = publisherColor(b.publisher); + const logo = retailerLogo(b.publisher); return (
-
- {b.publisher} -
+ {logo ? ( + {b.publisher} + ) : ( +
+ {b.publisher} +
+ )} {b.hasKoenigPilsener && ( 🍺 )} @@ -195,16 +224,15 @@ export default function Koepi({ toast }) { }; return ( -
+
{/* Header */} -
-

+
+

🍺 KÖPI — König Pilsener

-
{isAdmin && (
+ WebkitOverflowScrolling:'touch', paddingBottom:2 }}>