Fix 403 error when loading music files

- Fix path traversal security check by using absolute paths
- Remove problematic fetch override that forced JSON headers on all API requests
- Add error tracking and visual indicators for failed tracks
- Correct music directory resolution for both relative and absolute paths

The main issue was the security validation comparing relative paths incorrectly,
causing legitimate music file requests to be rejected with 403 errors.
This commit is contained in:
2025-08-10 01:28:16 -06:00
parent d3d0811a9f
commit bf7413b45f
5 changed files with 88 additions and 46 deletions

View File

@@ -29,6 +29,7 @@
:is-active="currentTrack?.name === track.name"
:is-playing="currentTrack?.name === track.name && isPlaying"
:is-loading="loadingTrack === track.name"
:has-error="failedTracks.has(track.name)"
@click="handleTrackClick(track, index)"
class="track-item-wrapper animate-fade-in-up"
/>
@@ -38,7 +39,6 @@
</template>
<script setup>
import { computed } from 'vue'
import { Music } from 'lucide-vue-next'
import TrackListItem from './TrackListItem.client.vue'
@@ -66,6 +66,10 @@ const props = defineProps({
loadingTrack: {
type: String,
default: null
},
failedTracks: {
type: Object, // Set object
default: () => new Set()
}
})