fix: correct BLS 4.0 category mapping for food search results
All checks were successful
CI / update (push) Successful in 3m27s

The CATEGORY_MAP was based on BLS 3.x letter codes which were completely
reshuffled in version 4.0. This caused wrong categories like Schwarztee
showing "Wurstwaren" instead of "Getränke". Remapped all 20 letter codes
to match actual BLS 4.0 Hauptlebensmittelgruppen and regenerated blsDb.
This commit is contained in:
2026-04-08 10:40:23 +02:00
parent 3bd80e60e1
commit 470d000125
2 changed files with 12 additions and 10 deletions

View File

@@ -94,15 +94,17 @@ const NUTRIENT_MAP: Record<string, { field: string; divisor?: number }> = {
TYR: { field: 'tyrosine' },
};
// BLS code first letter → category (BLS 4.0 Hauptgruppen)
// BLS 4.0 code first letter → category (Hauptlebensmittelgruppen)
const CATEGORY_MAP: Record<string, string> = {
A: 'Getränke', B: 'Getreideprodukte', C: 'Getreide', D: 'Backwaren',
E: 'Gemüse', F: 'Obst', G: 'Hülsenfrüchte',
H: 'Gewürze und Kräuter', J: 'Fette und Öle', K: 'Milch und Milchprodukte',
L: 'Eier', M: 'Fleisch', N: 'Wurstwaren', O: 'Wild', P: 'Geflügel',
Q: 'Fisch und Meeresfrüchte', R: 'Süßwaren', S: 'Zucker und Honig',
T: 'Gerichte und Rezepte', U: 'Pilze', V: 'Sonstiges', W: 'Algen',
X: 'Fleischersatz', Y: 'Supplemente',
B: 'Brot & Backwaren', C: 'Getreide', D: 'Dauerbackwaren & Kekse',
E: 'Teigwaren & Nudeln', F: 'Obst & Früchte', G: 'Gemüse',
H: 'Hülsenfrüchte & Sojaprodukte', K: 'Kartoffeln & Stärke',
M: 'Milch & Milchprodukte', N: 'Getränke (alkoholfrei)',
P: 'Alkoholische Getränke', Q: 'Fette & Öle',
R: 'Gewürze & Würzmittel', S: 'Zucker & Honig',
T: 'Fisch & Meeresfrüchte', U: 'Fleisch',
V: 'Wild & Kaninchen', W: 'Wurstwaren',
X: 'Brühen & Fertiggerichte', Y: 'Gerichte & Rezepte',
};
async function main() {