fix: KöPi - Bilder mit korrekten Namen von dir

This commit is contained in:
2026-07-09 16:28:23 +02:00
parent 15392b2841
commit 940bf3f103
5 changed files with 8 additions and 14 deletions

View File

@@ -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 });
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

After

Width:  |  Height:  |  Size: 112 KiB

View File

@@ -37,7 +37,7 @@ function OfferCard({ offer }) {
{/* Bild oben */}
{offer.imageLocal && (
<div style={{ margin:'-12px -14px 8px -14px', borderRadius:'8px 8px 0 0', background:'transparent', height:130, display:'flex', alignItems:'center', justifyContent:'center' }}>
<img src={offer.imageLocal} alt="König Pilsener"
<img src={offer.imageLocal + '?v=4'} alt="König Pilsener"
style={{ maxWidth:'90%', maxHeight:'130px', width:'auto', height:'auto', display:'block', objectFit:'contain' }}
/>
</div>