Skip to content

fix(songs): list single-segment folders such as /music (#61) - #62

Merged
suitux merged 1 commit into
suitux:mainfrom
Hellraiser28:fix/folder-songs-61
Oct 23, 2026
Merged

suitux merged 1 commit into
suitux:mainfrom
Hellraiser28:fix/folder-songs-61

Conversation

@Hellraiser28

Copy link
Copy Markdown
Contributor

Fixes #61.

With MUSIC_FOLDERS=/music,/audiobooks the root folders have a single path segment. The song list requested /api/songs/music, and Next.js routes a single segment to /api/songs/[id] before the optional catch-all /api/songs/[[...path]]. That route answers 400 Invalid song ID, so the list stayed empty and the header showed ? files. A subfolder named like a song sub-route had the same problem, e.g. /music/audio went to /api/songs/[id]/audio.

The list now sends the folder as a folderPath query parameter, the way the adjacent and bulk endpoints already receive it. The route reads folderPath first and still accepts the folder as path segments.

Tested

  • route.test.ts with 4 new tests; all 329 tests pass. ESLint, Prettier and tsc are clean on the changed files (the unused SongColumnFilters import warning in route.ts is already on main).
  • Docker build of this branch with MUSIC_FOLDERS=/music,/audiobooks, files directly in /music and a subfolder /music/audio:
    • v1.15.0: /music, /audiobooks and /music/audio return 400 Invalid song ID.
    • This branch: /music lists its 7 songs, /music/audio 1, /music/Albums/Amrinder Gill/Judaa 3, All Folders 13.
    • In the browser, clicking music and audio shows the songs and the file count.

@suitux
suitux merged commit 855095d into suitux:main Oct 23, 2026
1 check failed
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.

Bug: No music files displayed due to a few failures

2 participants