feat: Sierra fixes

This commit is contained in:
Brennan Wilkes (Text Groove) 2026-02-10 00:35:09 -08:00
parent 4862558970
commit 06103b2a53

View file

@ -56,8 +56,12 @@ function parseWooStoreProductsJson(payload, ctx) {
const price = formatWooStorePrice(p.prices); const price = formatWooStorePrice(p.prices);
const id = (p && (p.id ?? p.id === 0)) ? String(p.id) : ""; const rawSku =
const taggedSku = id ? `id:${id}` : ""; (typeof p?.sku === "string" && p.sku.trim()) ? p.sku.trim()
: (p && (p.id ?? p.id === 0)) ? String(p.id)
: "";
const taggedSku = /^\d{1,11}$/.test(rawSku) ? `id:${rawSku}` : rawSku;
const sku = normalizeSkuKey(taggedSku, { storeLabel: ctx?.store?.name, url }); const sku = normalizeSkuKey(taggedSku, { storeLabel: ctx?.store?.name, url });
const img = const img =
@ -344,8 +348,6 @@ async function scanCategoryWooStoreApi(ctx, prevDb, report) {
); );
} }
function createStore(defaultUa) { function createStore(defaultUa) {
const ua = defaultUa; const ua = defaultUa;