feat: Add scrobble-command to Listenbrainz

Signed-off-by: SindreKjelsrud <sindre@kjelsrud.dev>
This commit is contained in:
SindreKjelsrud 2026-01-13 22:11:01 +01:00
parent 49c4a79845
commit f1b31fabda
Signed by: sidski
GPG key ID: D2BBDF3EDE6BA9A6
10 changed files with 541 additions and 46 deletions

View file

@ -7,8 +7,10 @@ A native Rust application to sync songs and albums from your self-hosted Navidro
- 🎵 Sync songs and albums from Navidrome
- 📱 Support for iPod stock OS
- 🎸 Support for Rockbox firmware
- 📊 Scrobble listening history to ListenBrainz
- ⚙️ Configurable sync options
- 🔄 Incremental sync support
- 📈 Terminal progress bars with live status
## Installation
@ -38,6 +40,10 @@ cargo build --release
albums = true
playlists = false
format = "mp3"
[listenbrainz]
# Optional - only needed for scrobbling to ListenBrainz
token = "your_listenbrainz_token"
```
3. Alternatively, use environment variables (prefixed with `NAVIPOD__`):
@ -53,37 +59,50 @@ cargo build --release
## Usage
### GUI Application
Launch the graphical interface:
```bash
navipod-gui
```
The GUI provides:
- Input fields for Navidrome URL, username, and password
- Firmware type selector (Stock/Rockbox)
- Mount point browser
- Real-time sync status and progress
- Error display
### Command Line
```bash
# Sync all configured content
navipod sync
# Sync all configured content (with progress bar)
cargo run -- sync
# Sync specific album
navipod sync --album "Album Name"
cargo run -- sync --album "Album Name"
# Sync specific artist
cargo run -- sync --artist "Artist Name"
# List available albums
navipod list-albums
cargo run -- list-albums
# Check iPod connection
navipod check
cargo run -- check
# Scrobble listening history to ListenBrainz
cargo run -- scrobble
# Scrobble and clear the log (with backup)
cargo run -- scrobble --clear
# Scrobble and clear without backup
cargo run -- scrobble --clear --no-backup
```
### Scrobbling to ListenBrainz
NaviPod can read the `.scrobbler.log` file from your Rockbox iPod and submit your listening history to ListenBrainz:
1. Get your ListenBrainz user token from https://listenbrainz.org/profile/
2. Add it to your `config.toml`:
```toml
[listenbrainz]
token = "your_token_here"
```
3. Run the scrobble command:
```bash
cargo run -- scrobble --clear
```
The `--clear` flag will remove the scrobbler log after successful submission (with automatic backup).
This is useful to avoid re-submitting the same listens next time.
## Requirements
- Rust 1.70+ (and Cargo)
@ -111,32 +130,13 @@ nix-shell
# Build in release mode
cargo build --release
# The binaries will be at:
# - target/release/navipod (CLI)
# - target/release/navipod-gui (GUI)
# The binary will be at:
# - target/release/navipod
# Install to your PATH (optional)
cargo install --path .
```
### Running the GUI
```bash
# Make sure you're in nix-shell first:
nix-shell
# After building, run:
./target/release/navipod-gui
# Or use cargo run:
cargo run --bin navipod-gui
```
**Note:** If you encounter Wayland or X11 library errors:
1. Make sure you're in `nix-shell` (it provides all necessary libraries)
2. The GUI will automatically use X11 if Wayland is not available
3. If you still have issues, try:
```bash
WAYLAND_DISPLAY= WINIT_UNIX_BACKEND=x11 ./target/release/navipod-gui
```
## Development
```bash