24-playlist-modes #46

Merged
matthias merged 4 commits from 24-playlist-modes into main 2025-11-04 18:23:58 +00:00
Owner

Implement "shuffle" and "persist" playlist settings according to #24

Implement "shuffle" and "persist" playlist settings according to #24
matthias self-assigned this 2025-10-31 13:26:08 +00:00
matthias added 4 commits 2025-10-31 13:26:09 +00:00
Add documentation of playlist database schema in DEVELOP.md.

Add settings for persist and shuffle to BTreeDB. Implement the different
persist modes. Shuffle will be implemented in a followup commit.

Signed-off-by: Matthias Blankertz <matthias@blankertz.org>
Signed-off-by: Matthias Blankertz <matthias@blankertz.org>
To simplify the playlist handling, enforce that the indices are always
formatted to the same length (5, which allows for 100000 entries, that
should be enough).

Then make the position stored in the Playlist object be a simple integer
instead of a database key. This simplifies the code, and will make
implementing shuffle much easier.

Signed-off-by: Matthias Blankertz <matthias@blankertz.org>
playlistdb: Implement shuffle
All checks were successful
Build RPi Pico firmware image / Build-Firmware (push) Successful in 3m22s
Check code formatting / Check-C-Format (push) Successful in 8s
Check code formatting / Check-Python-Flake8 (push) Successful in 10s
Check code formatting / Check-Bash-Shellcheck (push) Successful in 5s
Run unit tests on host / Run-Unit-Tests (push) Successful in 8s
Run pytests / Check-Pytest (push) Successful in 11s
6a9ff9eb0a
Initial implementation of shuffle with a naive algorithm.

Signed-off-by: Matthias Blankertz <matthias@blankertz.org>
matthias requested review from Members 2025-10-31 13:26:09 +00:00
stefank approved these changes 2025-11-04 18:23:03 +00:00
matthias merged commit 55718aa1ff into main 2025-11-04 18:23:58 +00:00
matthias deleted branch 24-playlist-modes 2025-11-04 18:23:59 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TonBERRY/tonberry-pico#46