The MusicServer has three ways to pick a random song:
Mode
Endpoint
How it picks
Normal
GET /api/v1/music/rand
A random soundtrack, then a random song from it
Low played
GET /api/v1/music/rand/low
Like normal, but favours soundtracks played less than average
Classic
GET /api/v1/music/rand/classic
Every song has the same chance, regardless of soundtrack
The game can only use normal and low played today. Settings has an on/off switch for low played (Settings.use_low_played_mode, LowPlayedCheckButton in popups/settings_popup.gd). MusicServerClient.fetch_random_song_classic() already exists but nothing calls it.
What to do
Replace the low-played switch with a choice between Normal, Low played and Classic, for example an OptionButton.
Store the choice in Settings as one value, an enum, in place of the use_low_played_mode bool.
quiz/song_loader.gd picks the endpoint from that value. fetch_random_song and fetch_random_song_classic can become one call that takes the mode.
Like low played today, the choice is not saved in settings.cfg.
The server will also start recording which mode was used, for statistics (MusicServer #37).
Acceptance criteria
Settings has a Normal / Low played / Classic choice in place of the low-played switch.
With Classic chosen, new songs come from /music/rand/classic.
Tests cover all three modes in test_song_loader.gd and the settings popup.
## Background
The MusicServer has three ways to pick a random song:
| Mode | Endpoint | How it picks |
|---|---|---|
| Normal | `GET /api/v1/music/rand` | A random soundtrack, then a random song from it |
| Low played | `GET /api/v1/music/rand/low` | Like normal, but favours soundtracks played less than average |
| Classic | `GET /api/v1/music/rand/classic` | Every song has the same chance, regardless of soundtrack |
The game can only use normal and low played today. Settings has an on/off switch for low played (`Settings.use_low_played_mode`, `LowPlayedCheckButton` in `popups/settings_popup.gd`). `MusicServerClient.fetch_random_song_classic()` already exists but nothing calls it.
## What to do
- Replace the low-played switch with a choice between Normal, Low played and Classic, for example an `OptionButton`.
- Store the choice in `Settings` as one value, an enum, in place of the `use_low_played_mode` bool.
- `quiz/song_loader.gd` picks the endpoint from that value. `fetch_random_song` and `fetch_random_song_classic` can become one call that takes the mode.
- Like low played today, the choice is not saved in `settings.cfg`.
The server will also start recording which mode was used, for statistics (MusicServer #37).
## Acceptance criteria
- [ ] Settings has a Normal / Low played / Classic choice in place of the low-played switch.
- [ ] With Classic chosen, new songs come from `/music/rand/classic`.
- [ ] Tests cover all three modes in `test_song_loader.gd` and the settings popup.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Background
The MusicServer has three ways to pick a random song:
GET /api/v1/music/randGET /api/v1/music/rand/lowGET /api/v1/music/rand/classicThe game can only use normal and low played today. Settings has an on/off switch for low played (
Settings.use_low_played_mode,LowPlayedCheckButtoninpopups/settings_popup.gd).MusicServerClient.fetch_random_song_classic()already exists but nothing calls it.What to do
OptionButton.Settingsas one value, an enum, in place of theuse_low_played_modebool.quiz/song_loader.gdpicks the endpoint from that value.fetch_random_songandfetch_random_song_classiccan become one call that takes the mode.settings.cfg.The server will also start recording which mode was used, for statistics (MusicServer #37).
Acceptance criteria
/music/rand/classic.test_song_loader.gdand the settings popup.