diff options
| author | salmonik <raisersoft@proton.me> | 2026-05-07 16:16:01 +0200 |
|---|---|---|
| committer | salmonik <raisersoft@proton.me> | 2026-05-07 16:16:01 +0200 |
| commit | 03f4585424d05dd50022759c7ad098fe06277f6e (patch) | |
| tree | 8b6e8a829afbfa949f7a55eaf5620ea99b17bf40 /PLAN.md | |
| parent | Add toggle command to resume/pause playback and fix queue display bug (diff) | |
| download | rsplayer-03f4585424d05dd50022759c7ad098fe06277f6e.tar.gz rsplayer-03f4585424d05dd50022759c7ad098fe06277f6e.zip | |
Fix queue bugs: play -i on empty queue, stale track replay after queue ends, shuffle preserving current position
- insert_after_current: guard against panic on empty queue
- play -i (now): skip position increment when queue was empty so track plays
- directory last: use audio.is_playing() instead of q.current() to avoid replaying finished track
- shuffle: only randomize tracks after current position
Diffstat (limited to '')
| -rw-r--r-- | PLAN.md | 40 |
1 files changed, 22 insertions, 18 deletions
| @@ -1,24 +1,28 @@ | |||
| 1 | # rsplayer Project Plan | 1 | # rsplayer Project Plan |
| 2 | 2 | ||
| 3 | ## Phase 1: Setup & Core | 3 | ## Phase 1: Setup & Core ✓ |
| 4 | 1. Initialize Rust project, add dependencies: `clap` (CLI/autocompletion), `rusqlite` (SQLite), `symphonia`/`cpal` (audio), `directories` (XDG paths), `serde`/`toml` (config), `tokio` (daemon async), `reqwest` (scrobbling). | 4 | 1. Initialize Rust project, add dependencies: `clap` (CLI/autocompletion), `rusqlite` (SQLite), `symphonia`/`cpal` (audio), `directories` (XDG paths), `serde`/`toml` (config), `tokio` (daemon async), `reqwest` (scrobbling). ✓ |
| 5 | 2. Config stored at `$XDG_CONFIG_HOME/rsplayer/config.toml`: `music_paths` (array of directories to scan), `scan_interval` (optional periodic rescan interval), scrobbling credentials, daemon socket path. Daemon auto-scans configured paths on first run if database is empty/missing. | 5 | 2. Config stored at `$XDG_CONFIG_HOME/rsplayer/config.toml`: `music_paths` (array of directories to scan), `scan_interval` (optional periodic rescan interval), scrobbling credentials, daemon socket path. ✓ |
| 6 | 3. SQLite library schema: `artists`, `albums`, `tracks` tables. Implement `rsp scan` to scan all paths in config's `music_paths`, populate/update database. Support `--force` full rescan, `--paths` override config paths. Auto-scan triggers on first run (if DB empty) and periodically per `scan_interval` config. | 6 | 3. SQLite library schema: `artists`, `albums`, `tracks` tables. Implement `rsp scan` to scan all paths in config's `music_paths`, populate/update database. ✓ |
| 7 | 7 | ||
| 8 | ## Phase 2: Daemon | 8 | ## Phase 2: Daemon ✓ |
| 9 | 1. Unix socket daemon (path: `$XDG_RUNTIME_DIR/rsplayer/daemon.sock`) for IPC. | 9 | 1. Unix socket daemon (path: `$XDG_RUNTIME_DIR/rsplayer/daemon.sock`) for IPC. ✓ |
| 10 | 2. Audio engine: Symphonia decode + CPAL output, support play/pause/stop/volume/seek. | 10 | 2. Audio engine: Symphonia decode + CPAL output, support play/pause/stop/volume/seek. ✓ |
| 11 | 3. Queue: in-memory, `last` (append to end, default), `now` (play immediately, ending current song playback), `next` (insert after current). | 11 | 3. Queue: in-memory, `last` (append to end, default), `now` (play immediately, ending current song playback), `next` (insert after current). ✓ |
| 12 | 4. Shuffle modes: `none` (linear playback), `all` (shuffle all tracks), `album` (shuffle within album). | 12 | 4. Shuffle modes: `none` (linear playback), `all` (shuffle all tracks), `album` (shuffle within album, structure ready). ✓ |
| 13 | 5. Scrobbling: Last.fm and ListenBrainz support via configured credentials. | ||
| 14 | 13 | ||
| 15 | ## Phase 3: CLI & Completion | 14 | ## Phase 3: CLI & Completion ✓ |
| 16 | 1. Clap-based CLI with all subcommands. Generate shell completions for bash/zsh/fish, suggest database artists/albums/tracks, file paths, and config keys/values. | 15 | 1. Clap-based CLI with all subcommands. ✓ |
| 17 | 2. `rsp status`: show player state, current track, progress, volume, next 2-3 queue items. | 16 | 2. Shell completions for bash/zsh/fish/powershell/elvish (`rsp completions`). PARTIALLY |
| 18 | 3. `rsp queue`: no arguments display current queue; with arguments add items (default `last` behavior). | 17 | 3. `rsp status`: show player state, current track, progress, volume, next 2-3 queue items. ✓ |
| 19 | 4. `rsp settings` subcommands: `get`, `set`, `list`, `unset` config values (music paths, scrobbling credentials, scan interval, etc.) without manual file editing. | 18 | 4. `rsp queue`: no arguments display current queue; with arguments add items (default `last` behavior). BUGGED |
| 19 | 5. `rsp settings` subcommands: `get`, `set`, `list`, `unset` config values. ✓ | ||
| 20 | 6. `rsp scan`: `--force` full rescan, `--paths` override config paths. Uses symphonia for metadata. ✓ | ||
| 21 | 7. `rsp play`: flexible insert options (`-i`/`--now`, `-n`/`--next`, `-l`/`--last`). ✓ | ||
| 20 | 22 | ||
| 21 | ## Phase 4: Polish | 23 | ## Phase 4: Polish |
| 22 | 1. Direct file/folder playback: prioritize database metadata if path matches known artist/album. | 24 | 1. [ ] Queue state persistence - Save queue to disk so it survives daemon restarts. |
| 23 | 2. Logging, systemd service unit, unit tests. | 25 | 2. [ ] Album shuffle mode - Implement proper `ShuffleMode::Album` (shuffle tracks within same album/folder). |
| 24 | 3. Periodic rescan logic per config's `scan_interval`. | 26 | 3. [ ] Scrobbling - Last.fm and ListenBrainz support via configured credentials. |
| 27 | 4. [ ] Logging and error handling improvements. | ||
| 28 | 5. [ ] Systemd service unit for auto-start. | ||
