From 16f4f03474e6149a6534967d9c635392d82a8fd1 Mon Sep 17 00:00:00 2001 From: Honey Date: Sun, 26 Apr 2026 01:37:08 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20playlist=20cover=20upload=20=E2=80=94=20?= =?UTF-8?q?send=20raw=20image=20body=20not=20multipart?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Navidrome expects Content-Type: image/* with raw binary body. Bump SW to ns-v34. Co-Authored-By: Claude Sonnet 4.6 --- app.js | 5 +++-- sw.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app.js b/app.js index 0622766..59a13f9 100644 --- a/app.js +++ b/app.js @@ -506,9 +506,10 @@ async function editPlCoverSelected(input){ document.getElementById('edit-pl-cover').innerHTML=``; try{ const token=await ndAuth(); - const form=new FormData();form.append('image',file); const res=await fetch(`${cfg.url}/api/playlist/${_currentPlaylist.id}/image`,{ - method:'POST',headers:{'X-Nd-Authorization':'Bearer '+token},body:form + method:'POST', + headers:{'X-Nd-Authorization':'Bearer '+token,'Content-Type':file.type||'image/jpeg'}, + body:file }); if(!res.ok)throw new Error(res.status); toast('Cover aktualisiert'); diff --git a/sw.js b/sw.js index 9b7648d..10022b7 100644 --- a/sw.js +++ b/sw.js @@ -1,4 +1,4 @@ -const CACHE = 'ns-v33'; +const CACHE = 'ns-v34'; const PRECACHE = ['/', 'index.html', 'styles.css', 'app.js', 'manifest.json', 'icon.svg']; const SKIP_PATHS = ['/rest/stream', '/rest/download', '/config.js'];