diff --git a/backend/src/tools/koepi/routes.js b/backend/src/tools/koepi/routes.js index d544437..2a4debb 100644 --- a/backend/src/tools/koepi/routes.js +++ b/backend/src/tools/koepi/routes.js @@ -108,21 +108,17 @@ async function scrapeMarktguru() { for (const offer of offers) { const desc = (offer.description || '').toLowerCase(); console.log('DESC:', JSON.stringify(desc), '| RETAILER:', offer.retailer); - const has033 = desc.includes('0,33'); - const has05 = desc.includes('0,5'); - const has20 = desc.includes('20 x 0,5') || desc.includes('20x0,5') || desc.includes('kasten = 20') || desc.includes('ka. 20'); - const has24 = desc.includes('24 x 0,33') || desc.includes('24x0,33'); - const has11 = desc.includes('11 x 0,5') || desc.includes('11x0,5'); if (desc.includes('steini')) { offer.imageLocal = '/koepi/kasten_steini.png'; - } else if (has11) { - offer.imageLocal = '/koepi/kasten_front.png'; + } else if (desc.includes('11 x 0,5') || desc.includes('11x0,5')) { + offer.imageLocal = '/koepi/kasten_lang.png'; } else if (desc.includes('6 x') || desc.includes('6x') || (desc.includes('flasche') && !desc.includes('kasten'))) { offer.imageLocal = '/koepi/traeger.png'; - } else if (has05) { - // Wenn 0,5l vorkommt (egal ob auch 0,33 dabei) → 0,5l Kasten - offer.imageLocal = '/koepi/kasten_lang.png'; - } else if (has033) { + } else if (desc.includes('24 x 0,33') || desc.includes('24x0,33') || desc.includes('24 x 0,33')) { + offer.imageLocal = '/koepi/kasten_033.png'; + } else if (desc.includes('0,5')) { + offer.imageLocal = '/koepi/kasten_050.png'; + } else if (desc.includes('0,33')) { offer.imageLocal = '/koepi/kasten_033.png'; } else { offer.imageLocal = '/koepi/kasten_050.png'; @@ -156,8 +152,6 @@ async function scrapeMarktguru() { if (o.description && (!existing.description || o.description.length < existing.description.length)) { existing.description = o.description; } - // Besseres Bild (erstes das nicht null ist behalten) - if (!existing.image && o.image) existing.image = o.image; } else { merged.set(key, { ...o }); } diff --git a/frontend/public/koepi/kasten_033.png b/frontend/public/koepi/kasten_033.png index 62cc964..21279ef 100644 Binary files a/frontend/public/koepi/kasten_033.png and b/frontend/public/koepi/kasten_033.png differ diff --git a/frontend/public/koepi/kasten_050.png b/frontend/public/koepi/kasten_050.png index 5f768b5..332b5e5 100644 Binary files a/frontend/public/koepi/kasten_050.png and b/frontend/public/koepi/kasten_050.png differ diff --git a/frontend/public/koepi/kasten_lang.png b/frontend/public/koepi/kasten_lang.png index fb9bd60..cbd3235 100644 Binary files a/frontend/public/koepi/kasten_lang.png and b/frontend/public/koepi/kasten_lang.png differ diff --git a/frontend/src/tools/koepi.jsx b/frontend/src/tools/koepi.jsx index 259287e..d95891c 100644 --- a/frontend/src/tools/koepi.jsx +++ b/frontend/src/tools/koepi.jsx @@ -37,7 +37,7 @@ function OfferCard({ offer }) { {/* Bild oben */} {offer.imageLocal && (