From 157749060e8429fbeb052f82744571c88632677a Mon Sep 17 00:00:00 2001 From: John Mizerek Date: Fri, 13 Feb 2026 09:02:32 -0800 Subject: [PATCH] Add debug logging and fix protocol-relative URL check Log sample imageUrls to console to debug why upload step is shown. Also handle protocol-relative URLs (//domain.com/...). Co-Authored-By: Claude Opus 4.5 --- portal/setup-wizard.html | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/portal/setup-wizard.html b/portal/setup-wizard.html index 4b45044..955bd55 100644 --- a/portal/setup-wizard.html +++ b/portal/setup-wizard.html @@ -1510,9 +1510,17 @@ // Check if items have imageUrl - skip upload step if they're remote URLs (will be downloaded by saveWizard) const itemsWithImages = (config.extractedData.items || []).filter(item => item.imageUrl).length; - const itemsWithRemoteImages = (config.extractedData.items || []).filter(item => - item.imageUrl && (item.imageUrl.startsWith('http://') || item.imageUrl.startsWith('https://')) - ).length; + const itemsWithRemoteImages = (config.extractedData.items || []).filter(item => { + if (!item.imageUrl) return false; + const url = item.imageUrl; + // Remote: http://, https://, or protocol-relative // + return url.startsWith('http://') || url.startsWith('https://') || url.startsWith('//'); + }).length; + + // Debug: log sample imageUrls + const sampleItems = (config.extractedData.items || []).filter(item => item.imageUrl).slice(0, 3); + console.log('Items with images:', itemsWithImages, 'Remote:', itemsWithRemoteImages); + console.log('Sample imageUrls:', sampleItems.map(i => i.imageUrl)); if (itemsWithRemoteImages > 0) { // Items have remote image URLs - saveWizard will download them, skip upload step