From b41b4567ad0de547e900c90465f8d61a81108029 Mon Sep 17 00:00:00 2001 From: salmonik Date: Sat, 9 May 2026 15:12:18 +0200 Subject: Add TODO for major rewrite phases --- TODO.md | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/TODO.md b/TODO.md index 1048440..59ba564 100644 --- a/TODO.md +++ b/TODO.md @@ -58,12 +58,44 @@ - [x] **Desktop notifications** - Send notifications on track change, queue end, and errors via `notify-rust`. +- [x] **Shuffle first song** - `update_shuffle_indices` now shuffles all indices when position is 0; directory playback uses `q.current()` instead of `files.first()`. + ## Remaining Work -- [ ] **Persist queue state** - Save queue to disk so it survives daemon restarts. (optional) +### Phase 1: Play Command Rewrite + +- [ ] **Rewrite `rsp play` behavior** + - No options: Add to end of queue. If queue is empty AND player is in PLAY state, play immediately + - `-i` / `--now`: Add after current track, then skip to it (insert + play) + - `-n` / `--next`: Add after current track, don't skip + - Remove `-l` / `--last` flag (redundant, it's default behavior) + - Update CLI definitions in `src/cli.rs` + - Update daemon handler in `src/daemon.rs` + +### Phase 2: Queue Display Rewrite + +- [ ] **Rewrite `rsp queue` behavior** + - If queue rows <= terminal rows, display as-is (no pager needed) + - If queue rows > terminal rows, pipe to pager (e.g., `less -R`) + - Get terminal size using `terminal_size` crate or `ansi_term` / `crossterm` + - Update queue display logic in `src/daemon.rs` + +### Phase 3: Shuffle Rewrite + +- [ ] **Rewrite shuffle mode** + - Always remember original queue (add `original_tracks: Vec` field) + - `rsp shuffle all`: Shuffle tracks after current position once, store original queue + - `rsp shuffle none`: Restore from original queue - keep already-played tracks in place, insert unplayed tracks in original order after current position + - `rsp shuffle album`: Shuffle tracks within each album's range separately (don't mix albums) + - Update `Queue` struct in `src/queue.rs` with original queue storage + - Update shuffle logic in `src/queue.rs` and daemon handlers in `src/daemon.rs` + +### Phase 4: Optional Features + +- [ ] **Persist queue state** - Save queue to disk so it survives daemon restarts. - [ ] **Scrobbling (Last.fm/ListenBrainz)** - Add scrobbling support via configured credentials. -- [x] **Shuffle first song** - `update_shuffle_indices` now shuffles all indices when position is 0; directory playback uses `q.current()` instead of `files.first()`. +- [ ] **Customize status display** - Variables like $ARTIST, $ALBUM, $TRACK available in config so `queue`, `status` and notifs can be customized -- [ ] **In album shuffle** - Shuffle songs within albums, don't mix albums together (only applies to shuffle: album). +- [ ] **Dynamic autocompletion of artists, albums and tracks** - Let shell communicate with the daemon so it returns autocompletions for shell \ No newline at end of file -- cgit v1.2.3