From 8a7c21429624ee561ace77ef18ec3b229da94f08 Mon Sep 17 00:00:00 2001 From: yabo083 <103875886+yabo083@users.noreply.github.com> Date: Tue, 20 Jan 2026 09:54:22 +0800 Subject: [PATCH] fix: use objStore.raw_url for current audio in share links (#363) Problem: Audio files couldn't play from share links (/@s/share_id) returning HTTP 500 errors. Root Cause: The audio preview component used rawLink(obj, true) to construct the audio URL. However, rawLink() generates URLs by concatenating paths on the frontend, which may lack proper authentication tokens or have incorrect path structure for share links. Other preview components (video, image, doc, etc.) correctly use objStore.raw_url, which is the complete download URL returned by the backend API with proper authentication already applied. Solution: For the currently selected audio file, use objStore.raw_url (backend-provided URL). For other files in the playlist, continue using rawLink() as before. This aligns the audio preview behavior with other preview components. Co-authored-by: Auto-fix --- src/pages/home/previews/audio.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/home/previews/audio.tsx b/src/pages/home/previews/audio.tsx index 5cf140c..458f88d 100644 --- a/src/pages/home/previews/audio.tsx +++ b/src/pages/home/previews/audio.tsx @@ -45,7 +45,10 @@ const Preview = () => { const audio = { name: obj.name, artist: "Unknown", - url: rawLink(obj, true), + // Use objStore.raw_url for current file (has correct auth tokens from backend) + // Use rawLink for other files in playlist + url: + obj.name === objStore.obj.name ? objStore.raw_url : rawLink(obj, true), cover: cover, lrc: lrc, }