Skip to content

Conversation

@yabo083
Copy link

@yabo083 yabo083 commented Jan 17, 2026

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:

url: rawLink(obj, true),

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:

  • ✅ Video preview: uses objStore.raw_url (line 55 in video.tsx)
  • ✅ Image preview: uses objStore.raw_url (line 60 in image.tsx)
  • ✅ Doc preview: uses objStore.raw_url (line 83 in doc.tsx)
  • ❌ Audio preview: was using rawLink(obj, true)This was the bug

objStore.raw_url 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 with correct auth).
For other files in the playlist, continue using rawLink() as before.

url: obj.name === objStore.obj.name ? objStore.raw_url : rawLink(obj, true),

This aligns the audio preview behavior with other preview components.

Changes

  • src/pages/home/previews/audio.tsx: Use objStore.raw_url for current audio file

Testing

  • Audio files in share links should now play correctly
  • Playlist functionality remains unchanged (other files still use rawLink)

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.
@xrgzs
Copy link
Member

xrgzs commented Jan 18, 2026

It should be more than just Audio that has this problem.

Copy link
Member

@jyxjjj jyxjjj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

问题不大,遇到一个修一个吧

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants