fix(pl24): cleaner BMW model — append chassis only, drop redundant line token
Some checks failed
QA Gate (P0/P1) / Test affected app (pull_request) Has been cancelled
Some checks failed
QA Gate (P0/P1) / Test affected app (pull_request) Has been cancelled
"Seri" is "{line} {chassis} [{variant}]" and the trim already implies the line
("520i"→5, "X3 sDrive20i"→X3), so append only the chassis(+variant): "520i G30",
"X3 sDrive20i G01" (was "520i 5 G30" / the redundant "X3 sDrive20i X3 G01").
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1079,10 +1079,14 @@ export class PL24Service {
|
||||
lookup("model_bilgisi", "model")?.trim() ||
|
||||
(data.description as string)?.split(" - ")[0]?.trim() ||
|
||||
"";
|
||||
const generation = lookup("seri", "model_tanimi");
|
||||
// "Seri" is "{line} {chassis} [{variant}]" ("5 G30", "X3 G01", "5 E60 MUE"). The trim already
|
||||
// implies the line ("520i"→5, "X3 sDrive20i"→X3), so drop the leading line token and append
|
||||
// only the chassis(+variant) → "520i G30", "X3 sDrive20i G01" (avoids a redundant "X3 X3").
|
||||
const seri = lookup("seri", "model_tanimi");
|
||||
const chassis = seri ? seri.replace(/^\S+\s+/, "").trim() : null;
|
||||
const model =
|
||||
generation && baseModel && !baseModel.toLowerCase().includes(generation.toLowerCase())
|
||||
? `${baseModel} ${generation}`
|
||||
chassis && baseModel && !baseModel.toLowerCase().includes(chassis.toLowerCase())
|
||||
? `${baseModel} ${chassis}`
|
||||
: baseModel;
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user