[object Object]

← back to Gmc Titlefix

add --samples-only mode: fix ONLY $4.25 samples @ 0.35lb, leave rolls (Steve: rolls already correct)

327c4baa6cbde07f9b3c1897844ba1e045f73858 · 2026-07-09 09:05:23 -0700 · steve

Files touched

Diff

commit 327c4baa6cbde07f9b3c1897844ba1e045f73858
Author: steve <steve@designerwallcoverings.com>
Date:   Thu Jul 9 09:05:23 2026 -0700

    add --samples-only mode: fix ONLY $4.25 samples @ 0.35lb, leave rolls (Steve: rolls already correct)
---
 gmc-weight-override.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gmc-weight-override.js b/gmc-weight-override.js
index f582953..80528e5 100644
--- a/gmc-weight-override.js
+++ b/gmc-weight-override.js
@@ -21,6 +21,7 @@ const WEIGHT_REAL = parseFloat(process.env.WEIGHT_REAL || '1');
 const WEIGHT_SAMPLE = parseFloat(process.env.WEIGHT_SAMPLE || '0.35');
 const args = process.argv.slice(2);
 const INCLUDE_SAMPLES = args.includes('--include-samples');
+const SAMPLES_ONLY = args.includes('--samples-only');  // Steve: rolls are already correct — fix ONLY samples @ 0.35lb
 const CREATE_DS = args.includes('--create-ds');
 const APPLY = args.includes('--apply');
 const DS = APPLY ? args[args.indexOf('--apply') + 1] : null;
@@ -36,7 +37,8 @@ function buildList() {
   for (const i of cat.items) {
     const needsWeight = (i.issues || []).includes('missing_shipping_weight');
     const isSample = Math.abs(i.price - 4.25) < 0.01;
-    if (needsWeight || (INCLUDE_SAMPLES && isSample)) {
+    if (SAMPLES_ONLY) { if (!isSample) continue; }   // Steve: rolls are already correct — fix ONLY samples
+    if (SAMPLES_ONLY ? isSample : (needsWeight || (INCLUDE_SAMPLES && isSample))) {
       targets.push({ offerId: i.offerId, contentLanguage: (i.id || '').split(':')[1] || 'en', feedLabel: i.country || 'US', weight: isSample ? WEIGHT_SAMPLE : WEIGHT_REAL, reason: needsWeight ? 'missing_shipping_weight' : 'sample-preemptive', title: i.title });
     }
   }

← f57f894 verify-link: check authoritative primary rule (reverse-point  ·  back to Gmc Titlefix  ·  weight-override: DEFAULT_DS so --apply needs no long arg (te 93e51cb →