dev #111
@@ -1789,6 +1789,30 @@ export class PL24FordLegacyService {
|
||||
`Ford: ${groups.length} groups for ${serviceName}/${familyId} catCode=${catCode ?? "none"} arch=${arch}`,
|
||||
);
|
||||
|
||||
// TEMP DEBUG: map the Ford catCode→vehicle-select→groups flow
|
||||
if (groups.length === 0 && arch === "LEGACY_FORD") {
|
||||
const vrows: Array<{ url: string; cap?: string }> = [];
|
||||
for (const seg of html.split(/<tr\s/)) {
|
||||
if (!seg.includes("tc-data-row")) continue;
|
||||
const m = seg.match(/\burl="([^"]+)"/);
|
||||
if (m?.[1].includes("vehicle.action")) {
|
||||
vrows.push({ url: m[1], cap: seg.match(/\bcaption="([^"]+)"/)?.[1]?.slice(0, 40) });
|
||||
}
|
||||
}
|
||||
this.logger.warn(
|
||||
`Ford VSEL ${familyId} cc=${catCode}: ${vrows.length} vehicle rows; first3=${JSON.stringify(vrows.slice(0, 3))}`,
|
||||
);
|
||||
if (vrows.length) {
|
||||
const vhtml = await this.fetchP4Page(vrows[0].url, serviceName, false);
|
||||
const vtc = vhtml ? (vhtml.match(/tc-data-row/g) || []).length : 0;
|
||||
const vgroups = vhtml ? this.parseFordGroupsFromHtml(vhtml, serviceName, familyId) : [];
|
||||
const vtitle = vhtml?.match(/<title>([^<]*)<\/title>/i)?.[1];
|
||||
this.logger.warn(
|
||||
`Ford VSEL child: len=${vhtml?.length} title="${vtitle}" tcRows=${vtc} parsedGroups=${vgroups.length} names=${JSON.stringify(vgroups.slice(0, 6).map((g) => g.nameTr))}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (groups.length > 0) {
|
||||
await this.redis.setJson(cacheKey, groups, 7200);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user