[object Object]

← back to Dw Launches

Media: dedup is now a toggle (Show: All colorways [default] / Unique patterns), persisted

7533052e6dfd19a91203559181b8c40c2c76959a · 2026-06-20 10:44:47 -0700 · Steve

Files touched

Diff

commit 7533052e6dfd19a91203559181b8c40c2c76959a
Author: Steve <steve@designerwallcoverings.com>
Date:   Sat Jun 20 10:44:47 2026 -0700

    Media: dedup is now a toggle (Show: All colorways [default] / Unique patterns), persisted
---
 public/index.html                   |  24 ++++++++++++++++++++----
 screenshot-zoffany-allcolorways.png | Bin 0 -> 636948 bytes
 2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/public/index.html b/public/index.html
index bf489d5..9dc7f73 100644
--- a/public/index.html
+++ b/public/index.html
@@ -1090,6 +1090,13 @@
     <nav class="ml-sources tabs" id="ml-sources"></nav>
     <div class="ht-spacer"></div>
     <input type="text" id="ml-search" class="ml-search" placeholder="Search title / vendor / caption…">
+    <div class="ht-ctrl">
+      <label for="ml-dedup">Show</label>
+      <select id="ml-dedup" class="ml-search" style="min-width:0;padding:6px 8px">
+        <option value="off">All colorways</option>
+        <option value="pattern">Unique patterns</option>
+      </select>
+    </div>
     <div class="ht-ctrl">
       <label for="ml-density">Density</label>
       <input type="range" id="ml-density" min="90" max="260" step="10" value="150">
@@ -1636,6 +1643,11 @@ async function renderMedia(){
   const search=document.getElementById('ml-search');
   search.oninput=()=>{ clearTimeout(mlSearchTimer); mlSearchTimer=setTimeout(()=>{
     mlState.q=search.value.trim(); mlReset(); }, 300); };
+  // dedup mode toggle (default = all colorways), persisted
+  const dd=document.getElementById('ml-dedup');
+  mlState.dedup = localStorage.getItem('dwlaunch:dedup') || 'off';
+  dd.value=mlState.dedup;
+  dd.onchange=()=>{ mlState.dedup=dd.value; try{localStorage.setItem('dwlaunch:dedup',dd.value);}catch(e){} mlReset(); };
 
   if(!mlState.sourcesLoaded) await mlLoadSources();
   mlReset();
@@ -1711,10 +1723,13 @@ async function mediaLoadMore(){
     const grid=document.getElementById('ml-grid');
     if(!mlState.seen) mlState.seen=new Set();
     let added=0;
+    const dedupOn = mlState.dedup && mlState.dedup!=='off';
     (d.items||[]).forEach(m=>{
-      const k=mlItemKey(m);
-      if(mlState.seen.has(k)){ mlState.dups=(mlState.dups||0)+1; return; } // skip duplicate pattern/image
-      mlState.seen.add(k);
+      if(dedupOn){
+        const k = mlState.dedup==='pattern' ? mlItemKey(m) : 'i:'+mlImgKey(m.url);
+        if(mlState.seen.has(k)){ mlState.dups=(mlState.dups||0)+1; return; }
+        mlState.seen.add(k);
+      }
       grid.appendChild(mlCard(m)); added++;
     });
     mlState.offset += (d.items||[]).length;
@@ -1730,7 +1745,8 @@ async function mediaLoadMore(){
         grid.innerHTML=`<div class="ml-empty muted">No matches.</div>`;
       }
     }
-    status.textContent = (grid.querySelectorAll('.ml-card').length).toLocaleString()+' unique image'+(grid.querySelectorAll('.ml-card').length===1?'':'s')+' shown'+(mlState.dups?` · ${mlState.dups.toLocaleString()} duplicate${mlState.dups===1?'':'s'} hidden`:'');
+    const shown=grid.querySelectorAll('.ml-card').length;
+    status.textContent = shown.toLocaleString()+' shown'+(mlState.dups?` · ${mlState.dups.toLocaleString()} duplicate${mlState.dups===1?'':'s'} hidden`:'');
   }catch(e){ status.textContent='Error: '+e.message; }
   finally{ mlState.loading=false; btn.disabled=false; }
 }
diff --git a/screenshot-zoffany-allcolorways.png b/screenshot-zoffany-allcolorways.png
new file mode 100644
index 0000000..3bbea3d
Binary files /dev/null and b/screenshot-zoffany-allcolorways.png differ

← 142baf6 Media: dedup grid — collapse colorway/reupload duplicates to  ·  back to Dw Launches  ·  Media: content-hash (md5) dedup — collapse byte-identical co 4782ead →