aboutsummaryrefslogtreecommitdiffstats
path: root/TODO.md
blob: bdca56903d407a1fde067ab8dfee5474dcc75043 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# TODO

## Completed ✓

- [x] **Dev/release build config separation** - Store config next to binary in dev mode, use XDG in release mode.

- [x] **Volume without argument returns current volume** - `rsp volume` now returns current level.

- [x] **Fix SampleRate access in audio.rs:104** - `config.sample_rate().0` is invalid because `cpal::SampleRate` is a type alias for `u32`, not a tuple struct.

- [x] **Implement previous track logic** (`src/playback.rs:99`) - Implemented basic previous() that restarts current track if playing/paused.

- [x] **Remove unused std::thread import** (`src/playback.rs:2`) - Removed commented out import.

- [x] **Run clippy** - All linting checks pass.

- [x] **Run tests** - All tests pass.

- [x] **Check formatting** - Code formatting is correct.

- [x] **Implement resume functionality** - Implemented pause/resume using cpal stream pause()/play() methods.

- [x] **Fix audio playback speed and buffer underrun** - Implemented proper sample buffering between callbacks to prevent audio skipping and buffer underrun errors.

- [x] **Add Resume CLI subcommand** - Added `Resume` subcommand to CLI so users can resume playback after pause.

- [x] **Implement shuffle mode** - Added shuffle on/off/album functionality with queue management in daemon. Supports `rsp shuffle on/off/album` commands.

- [x] **Implement next/previous commands** - Next and previous track commands now work with the queue system.

- [x] **Queue entire directory** - When playing a folder, all audio files are now queued instead of just the first one.

- [x] **Auto-play next track** - Daemon automatically plays next track when current one ends (using `poll_track_ended()`).

- [x] **Queue display with pager** - `rsp queue` shows all queued tracks with pager support for long lists.

- [x] **Album shuffle mode structure** - `ShuffleMode::Album` added to enum and queue logic (behaves like `All` until database ready).

- [x] **Metadata extraction and display** - Extract ID3/metadata tags from audio files and display as "INDEX. ARTIST - TITLE", falls back to filename. Uses symphonia for metadata extraction.

- [x] **Flexible play command** - Added `-i/--now`, `-n/--next`, `-l/--last` flags to play command: `play MUSIC` (default - add to end and play), `play -i MUSIC` (insert after current and skip to it), `play -n MUSIC` (insert after current, don't skip), `play -l MUSIC` (add to end of queue). Also fixed queue display to correctly show playing track.

- [x] **Add unit tests for Player struct** - Tests added for Player, Track, PlaybackState, and ShuffleMode in `tests/playback.rs`.

- [x] **Database scan command** - Implemented `rsp scan` with `--force` full rescan and `--paths` override options. Uses symphonia for metadata extraction.

- [x] **Settings subcommands** - Implemented `rsp settings get/set/list/unset` for config management.

- [x] **Shell completions** - Generate shell completions with `rsp completions bash|elvish|fish|powershell|zsh`.

- [x] **Extract queue module** - Moved `Queue`, `Track`, `ShuffleMode`, `AudioMetadata` from daemon into `src/queue.rs` with public API and accessor methods.

- [x] **Comprehensive queue tests** - 34 tests covering navigation, shuffle, insert ordering, edge cases, and display.

- [x] **Fix queue/play bugs** - `rsp play <file>` no longer interrupts playback when something is already playing; directory `play -n`/`play -i` now inserts in correct order; removed dead duplicate shuffle handler; queue display no longer shows `(playing)` when playback is stopped.

- [x] **Systemd service unit** - Create systemd service file for auto-start.

- [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

### Phase 1-3: Completed ✓

- [x] **Play command rewrite** - No args queues to end (play if queue empty + not playing), -i inserts and plays, -n inserts without playing, removed -l flag
- [x] **Queue display rewrite** - Returns full output (client can pipe to pager), removed daemon-side pager (fails without TTY)

- [x] **Shuffle rewrite** - Always remembers original queue, shuffle none keeps played tracks in place, album shuffle groups by album

### Optional Features

- [ ] **Persist queue state** - Save queue to disk so it survives daemon restarts.

- [ ] **Scrobbling (Last.fm/ListenBrainz)** - Add scrobbling support via configured credentials.

- [ ] **Customize status display** - Variables like $ARTIST, $ALBUM, $TRACK available in config so `queue`, `status` and notifs can be customized

- [ ] **Dynamic autocompletion of artists, albums and tracks** - Let shell communicate with the daemon so it returns autocompletions for shell