fix: playlist cover upload — send raw image body not multipart
Navidrome expects Content-Type: image/* with raw binary body. Bump SW to ns-v34. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
1c59b4eccd
commit
16f4f03474
2 files changed
+4
-3
No files matched your search
@@ -506,9 +506,10 @@ async function editPlCoverSelected(input){
|
|||||||
document.getElementById('edit-pl-cover').innerHTML=`<img src="${preview}" style="width:100%;height:100%;object-fit:cover">`;
|
document.getElementById('edit-pl-cover').innerHTML=`<img src="${preview}" style="width:100%;height:100%;object-fit:cover">`;
|
||||||
try{
|
try{
|
||||||
const token=await ndAuth();
|
const token=await ndAuth();
|
||||||
const form=new FormData();form.append('image',file);
|
|
||||||
const res=await fetch(`${cfg.url}/api/playlist/${_currentPlaylist.id}/image`,{
|
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);
|
if(!res.ok)throw new Error(res.status);
|
||||||
toast('Cover aktualisiert');
|
toast('Cover aktualisiert');
|
||||||
|
|||||||
@@ -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 PRECACHE = ['/', 'index.html', 'styles.css', 'app.js', 'manifest.json', 'icon.svg'];
|
||||||
const SKIP_PATHS = ['/rest/stream', '/rest/download', '/config.js'];
|
const SKIP_PATHS = ['/rest/stream', '/rest/download', '/config.js'];
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user