Add a soundtrack by picking or dropping a folder (#50) #52

Open
Sansan wants to merge 2 commits from feature/50-upload-soundtrack into develop
pull from: feature/50-upload-soundtrack
Owner

Adds a soundtrack to the server from a folder: picked with Add soundtrack… in the statistics toolbar, or dropped anywhere on the window. Closes #50.

Depends on Sansan/MusicServer#39 (the upload API, #33). Merge that first: this calls POST /soundtracks/uploads, PUT …/files/{file}, POST …/finish and DELETE ….

What it does

  • Lists the folder's songs with their sizes, and the total. The name comes from the folder and can be changed; characters the server refuses are replaced.
  • Uploads only MP3s, as the server takes no other. Other song files (ogg, flac, …) are listed greyed out as "not MP3, left out". Hidden files are skipped.
  • Disc folders are flattened with the disc's number first (Disc 2/01 Song.mp3 → 2-01 Song.mp3), since the server wants one folder. With only one disc folder, names stay as they are.
  • Sends one song at a time with a progress bar, reading one file at a time. A failed song is sent again twice; then the upload is cancelled on the server and the server's reason is shown. Closing the popup cancels it.
  • Not offered while the server syncs, offline (music folder), or without MP3s.
  • Afterwards search, the inspiration list and the statistics reload, so the new soundtrack shows up at once.

Tests

  • test_upload_folder.gd: MP3s in natural order, disc numbering (one disc vs several, folders without songs aren't discs), left-out files, hidden files, name cleaning, duplicate names.
  • test_upload_popup.gd: the calls in order with the right bodies and audio/mpeg; a retry that recovers; a song that keeps failing cancels the upload; a taken name shows the server's reason; closing cancels; no upload while syncing; dropping a folder or songs.
  • The screenshot tour has the popup ready and mid-upload; layout baseline retaken.
  • All 799 tests pass.

Tried against the real server

On the server's branch: dropped a two-disc test folder, uploaded it ("Added Upload test MusicPlayer with 3 songs"), saw it in Search and Statistics, and got the server's "already exists" reason on a second try. The test folder was then deleted and a sync removed the soundtrack again.

🤖 Generated with Claude Code

Adds a soundtrack to the server from a folder: picked with **Add soundtrack…** in the statistics toolbar, or dropped anywhere on the window. Closes #50. **Depends on Sansan/MusicServer#39** (the upload API, #33). Merge that first: this calls `POST /soundtracks/uploads`, `PUT …/files/{file}`, `POST …/finish` and `DELETE …`. ## What it does - Lists the folder's songs with their sizes, and the total. The name comes from the folder and can be changed; characters the server refuses are replaced. - Uploads only MP3s, as the server takes no other. Other song files (ogg, flac, …) are listed greyed out as "not MP3, left out". Hidden files are skipped. - Disc folders are flattened with the disc's number first (`Disc 2/01 Song.mp3` → `2-01 Song.mp3`), since the server wants one folder. With only one disc folder, names stay as they are. - Sends one song at a time with a progress bar, reading one file at a time. A failed song is sent again twice; then the upload is cancelled on the server and the server's reason is shown. Closing the popup cancels it. - Not offered while the server syncs, offline (music folder), or without MP3s. - Afterwards search, the inspiration list and the statistics reload, so the new soundtrack shows up at once. ## Tests - `test_upload_folder.gd`: MP3s in natural order, disc numbering (one disc vs several, folders without songs aren't discs), left-out files, hidden files, name cleaning, duplicate names. - `test_upload_popup.gd`: the calls in order with the right bodies and `audio/mpeg`; a retry that recovers; a song that keeps failing cancels the upload; a taken name shows the server's reason; closing cancels; no upload while syncing; dropping a folder or songs. - The screenshot tour has the popup ready and mid-upload; layout baseline retaken. - All 799 tests pass. ## Tried against the real server On the server's branch: dropped a two-disc test folder, uploaded it ("Added Upload test MusicPlayer with 3 songs"), saw it in Search and Statistics, and got the server's "already exists" reason on a second try. The test folder was then deleted and a sync removed the soundtrack again. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sansan added the improvement label 2026-10-15 21:45:10 +02:00
Sansan added 1 commit 2026-10-15 21:45:10 +02:00
Add a soundtrack by picking or dropping a folder (#50)
Build / test (pull_request) Successful in 2m3s
Build / build (pull_request) Skipped
c86dacb890
"Add soundtrack…" in the statistics toolbar, or a folder dropped anywhere on
the window, opens a popup that lists the folder's songs and uploads them to
the server, which adds the soundtrack at once (Sansan/MusicServer#33).

- The name comes from the folder and can be changed; characters the server
  refuses are replaced.
- Only MP3s are uploaded, as the server takes no other; other song files
  are listed greyed out as left out. Hidden files are skipped.
- Disc folders are flattened with the disc's number first ("1-01 Title.mp3"),
  as the server wants one folder. With one disc folder, names stay as
  they are.
- Songs are sent one at a time with a progress bar, reading one file at a
  time. A failed song is sent again twice, then the upload is cancelled
  and the server's reason shown. Closing the popup cancels it too.
- Not offered while the server syncs, offline, or without MP3s.
- Afterwards search, the inspiration list and the statistics reload.

The API types come from the server's spec (Upload, UploadFile,
UploadRequest).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sansan added feature and removed improvement labels 2026-10-15 21:51:33 +02:00
Sansan added the area/syncneeds-server labels 2026-10-15 21:52:45 +02:00
Sansan added 1 commit 2026-10-16 11:29:19 +02:00
Merge develop into feature/50-upload-soundtrack
Build / test (pull_request) Successful in 2m3s
Build / build (pull_request) Skipped
8263781abc
The API spec is now formatted like before (2-space indents, sorted keys):
develop's spec with the upload paths and types added, so the diff to
develop is only the upload API.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
All checks were successful
Build / test (pull_request) Successful in 2m3s
Build / build (pull_request) Skipped
You are not authorized to merge this pull request.
This pull request can be merged automatically.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feature/50-upload-soundtrack:feature/50-upload-soundtrack
git checkout feature/50-upload-soundtrack
Sign in to join this conversation.