mirror of
https://github.com/OpenListTeam/OpenList-Frontend.git
synced 2026-03-13 11:20:24 +00:00
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 <auto@fix.local>
This commit is contained in:
@@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user