From ce53c4883513bdd9f2146e0fa71833cf8f334644 Mon Sep 17 00:00:00 2001 From: Honey Date: Sun, 26 Apr 2026 02:06:41 +0200 Subject: [PATCH] fix: playlist cover auto-refresh after upload Re-generate coverUrl (includes fresh auth params) + append _cb=timestamp to bypass browser cache. Update both detail view and edit modal preview. Co-Authored-By: Claude Sonnet 4.6 --- app.js | 6 ++++-- sw.js | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app.js b/app.js index 8e48b5c..3709016 100644 --- a/app.js +++ b/app.js @@ -515,8 +515,10 @@ async function editPlCoverSelected(input){ if(!res.ok)throw new Error(res.status); toast('Cover aktualisiert'); setTimeout(()=>{ - const cv=document.getElementById('playlist-cover'); - const img=cv?.querySelector('img');if(img)img.src=img.src.split('?')[0]+'?t='+Date.now(); + const bust=coverUrl(_currentPlaylist.coverArt,300)+'&_cb='+Date.now(); + const detailImg=document.getElementById('playlist-cover'); + if(detailImg)detailImg.innerHTML=``; + document.getElementById('edit-pl-cover').innerHTML=``; },800); }catch(e){ _ndToken=null; diff --git a/sw.js b/sw.js index 95d3357..1c99d91 100644 --- a/sw.js +++ b/sw.js @@ -1,4 +1,4 @@ -const CACHE = 'ns-v36'; +const CACHE = 'ns-v37'; const PRECACHE = ['/', 'index.html', 'styles.css', 'app.js', 'manifest.json', 'icon.svg']; const SKIP_PATHS = ['/rest/stream', '/rest/download', '/config.js'];