fix: use objStore.raw_url for current audio in share links #363
+4
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.Comparison with other preview components:
objStore.raw_url(line 55 in video.tsx)objStore.raw_url(line 60 in image.tsx)objStore.raw_url(line 83 in doc.tsx)rawLink(obj, true)← This was the bugobjStore.raw_urlis 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 with correct auth).For other files in the playlist, continue using
rawLink()as before.This aligns the audio preview behavior with other preview components.
Changes
src/pages/home/previews/audio.tsx: UseobjStore.raw_urlfor current audio fileTesting