Skip to content

Commit 0656998

Browse files
colonelpanic8claude
andcommitted
docs: improve README structure and content
- Fix CI badge URL to point to correct repository - Add installation instructions with crates.io and source options - Restructure features section with emoji icons for clarity - Improve Quick Start section with clearer examples - Format command-line options in code block - Reorganize configuration sections with better hierarchy - Simplify cleaning system explanations - Add development, contributing, and license sections - Overall improvements to readability and navigation 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 8764571 commit 0656998

File tree

1 file changed

+101
-88
lines changed

1 file changed

+101
-88
lines changed

README.md

Lines changed: 101 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,84 @@
11
# Scrobble Scrubber
22

3-
[![CI](https://github.com/colonelpanic8/scrobble-scrubber/actions/workflows/ci.yml/badge.svg)](https://github.com/imalison/scrobble-scrubber/actions/workflows/ci.yml)
3+
[![CI](https://github.com/colonelpanic8/scrobble-scrubber/actions/workflows/ci.yml/badge.svg)](https://github.com/colonelpanic8/scrobble-scrubber/actions/workflows/ci.yml)
44
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
55
[![Crates.io](https://img.shields.io/crates/v/scrobble-scrubber.svg)](https://crates.io/crates/scrobble-scrubber)
66
[![docs.rs](https://docs.rs/scrobble-scrubber/badge.svg)](https://docs.rs/scrobble-scrubber)
77

8-
> **📖 For end users:** See the [**User Guide**](USER_GUIDE.md) for installation and usage instructions.
9-
10-
Automated Last.fm track monitoring and scrubbing system that continuously monitors your recent tracks and applies cleaning rules to fix common issues.
8+
Automated Last.fm scrobble monitoring and correction tool that continuously monitors your recent tracks and applies intelligent cleaning rules to fix metadata issues.
119

1210
## Features
1311

14-
- **Continuous Monitoring**: Polls your recent tracks at configurable intervals
15-
- **State Management**: Remembers which tracks have been processed to avoid duplicates
16-
- **Multiple Cleaning Providers**:
17-
- **Rewrite Rules**: Fast pattern-based cleaning (removes remaster suffixes, normalizes featuring formats, trims whitespace)
18-
- **OpenAI Provider**: AI-powered metadata cleaning for complex issues requiring musical knowledge
19-
- **MusicBrainze Provider**: Uses musicbrainz release library to correct metadata
20-
- **Self-Improving AI Integration**: The AI provider not only handles complex metadata issues but also identifies patterns for new automated rules, creating a system that gets smarter over time
21-
- **Dry Run Mode**: Test changes without actually modifying your scrobbles
22-
- **Flexible Configuration**: Environment variables, config files, and command-line arguments
12+
- **🔄 Continuous Monitoring**: Automatically polls your recent tracks at configurable intervals
13+
- **💾 Smart State Management**: Tracks processed scrobbles to avoid duplicate corrections
14+
- **🧹 Multiple Cleaning Providers**:
15+
- **Pattern-Based Rules**: Lightning-fast regex-based cleaning for common issues
16+
- **MusicBrainz Integration**: Validates and corrects metadata against the MusicBrainz database
17+
- **AI-Powered Cleaning**: OpenAI integration for complex metadata issues requiring musical context
18+
- **Compilation Detection**: Intelligently moves tracks from compilations to original albums
19+
- **🎯 Self-Improving System**: AI provider identifies patterns for new automated rules
20+
- **🔍 Dry Run Mode**: Preview changes before applying them to your scrobbles
21+
- **⚙️ Flexible Configuration**: Supports environment variables, config files, and CLI arguments
22+
- **🖥️ Interactive TUI**: Terminal user interface for managing rules and monitoring corrections
23+
24+
## Quick Start
2325

24-
## Usage
26+
### Installation
2527

26-
Set up environment variables:
2728
```bash
28-
# Required: Last.fm credentials
29-
export SCROBBLE_SCRUBBER_LASTFM_USERNAME="your_username"
30-
export SCROBBLE_SCRUBBER_LASTFM_PASSWORD="your_password"
29+
# Install from crates.io
30+
cargo install scrobble-scrubber
3131

32-
# Optional: OpenAI provider for AI-powered metadata cleaning
33-
export SCROBBLE_SCRUBBER_PROVIDERS_ENABLE_OPENAI=true
34-
export SCROBBLE_SCRUBBER_PROVIDERS_OPENAI_API_KEY="sk-..."
32+
# Or build from source
33+
git clone https://github.com/colonelpanic8/scrobble-scrubber
34+
cd scrobble-scrubber
35+
cargo build --release
3536
```
3637

37-
Run the scrubber:
38-
```bash
39-
# Basic usage (checks every 5 minutes)
40-
cargo run
38+
### Basic Setup
4139

42-
# Custom interval (check every 10 minutes)
43-
cargo run -- --interval 600
40+
```bash
41+
# Required: Last.fm credentials
42+
export SCROBBLE_SCRUBBER_LASTFM_USERNAME="your_username"
43+
export SCROBBLE_SCRUBBER_LASTFM_PASSWORD="your_password"
4444

45-
# Dry run mode (see what would be changed)
46-
cargo run -- --dry-run
45+
# Run the scrubber (checks every 5 minutes by default)
46+
scrobble-scrubber
4747

48-
# Limit tracks per cycle
49-
cargo run -- --max-tracks 50
48+
# Or with custom settings
49+
scrobble-scrubber --interval 600 --dry-run
5050
```
5151

5252
## Command Line Options
5353

54-
- `-i, --interval <SECONDS>`: Check interval in seconds (default: 300)
55-
- `-m, --max-tracks <NUMBER>`: Maximum tracks to process per run (default: 100)
56-
- `--dry-run`: Show what would be changed without making actual edits
54+
```
55+
scrobble-scrubber [OPTIONS]
56+
57+
Options:
58+
-i, --interval <SECONDS> Check interval in seconds [default: 300]
59+
-m, --max-tracks <NUMBER> Maximum tracks to process per run [default: 100]
60+
--dry-run Preview changes without applying them
61+
--config <PATH> Path to configuration file
62+
-h, --help Print help information
63+
-V, --version Print version information
64+
```
65+
66+
## Configuration
5767

58-
## Environment Variables
68+
### Environment Variables
5969

60-
All environment variables use the `SCROBBLE_SCRUBBER_` prefix and follow the configuration structure:
70+
All environment variables use the `SCROBBLE_SCRUBBER_` prefix:
6171

62-
### Required Configuration
72+
#### Required
6373
```bash
6474
# Last.fm credentials
6575
export SCROBBLE_SCRUBBER_LASTFM_USERNAME="your_lastfm_username"
6676
export SCROBBLE_SCRUBBER_LASTFM_PASSWORD="your_lastfm_password"
6777
```
6878

69-
### OpenAI Provider (Optional)
79+
#### Optional Providers
80+
81+
**OpenAI Integration**
7082
```bash
7183
# Enable OpenAI provider for AI-powered metadata cleaning
7284
export SCROBBLE_SCRUBBER_PROVIDERS_ENABLE_OPENAI=true
@@ -76,7 +88,7 @@ export SCROBBLE_SCRUBBER_PROVIDERS_OPENAI_API_KEY="sk-..."
7688
export SCROBBLE_SCRUBBER_PROVIDERS_OPENAI_MODEL="gpt-4o-mini"
7789
```
7890

79-
### Scrubber Settings
91+
#### Scrubber Settings
8092
```bash
8193
# Check interval in seconds (default: 300)
8294
export SCROBBLE_SCRUBBER_SCRUBBER_INTERVAL=300
@@ -91,7 +103,7 @@ export SCROBBLE_SCRUBBER_SCRUBBER_DRY_RUN=true
91103
export SCROBBLE_SCRUBBER_SCRUBBER_REQUIRE_CONFIRMATION=false
92104
```
93105

94-
### Other Settings
106+
#### Additional Settings
95107
```bash
96108
# Enable/disable providers
97109
export SCROBBLE_SCRUBBER_PROVIDERS_ENABLE_REWRITE_RULES=true
@@ -104,7 +116,7 @@ export SCROBBLE_SCRUBBER_STORAGE_STATE_FILE="scrobble_state.db"
104116
export SCROBBLE_SCRUBBER_LASTFM_BASE_URL="https://www.last.fm"
105117
```
106118

107-
### Configuration File Locations
119+
### Configuration Files
108120

109121
Configuration files are searched for in this order:
110122
1. `./scrobble-scrubber.toml` (current directory)
@@ -114,67 +126,68 @@ Configuration files are searched for in this order:
114126
5. `~/.config/scrobble-scrubber/config.toml` (legacy fallback)
115127
6. `~/.scrobble-scrubber.toml` (legacy fallback)
116128

117-
### Configuration Priority
118-
Configuration is loaded in this order (highest priority first):
129+
**Priority Order** (highest to lowest):
119130
1. Command line arguments
120-
2. Environment variables (with `SCROBBLE_SCRUBBER_` prefix)
121-
3. Configuration file (first found from locations above)
122-
4. Defaults
131+
2. Environment variables
132+
3. Configuration file
133+
4. Built-in defaults
134+
135+
See [`config.example.toml`](config.example.toml) for a complete configuration example.
123136

124-
### Example Configuration File
137+
## How It Works
125138

126-
See `config.example.toml` for a complete example configuration file with all available options and their defaults.
139+
### Cleaning Providers
127140

128-
## Cleaning System
141+
#### 1. Pattern-Based Rules
142+
Fast regex-based cleaning for common issues:
143+
- **Remaster suffixes**: `(2019 Remaster)`, `- Remastered`, etc.
144+
- **Featuring formats**: Normalizes `ft.`, `featuring`, `feat.` variations
145+
- **Whitespace**: Trims and normalizes spacing
146+
- **Custom patterns**: User-defined regex rules with capture groups
129147

130-
The scrobble scrubber uses a two-tier cleaning approach:
148+
#### 2. MusicBrainz Integration
149+
Validates and corrects metadata against the MusicBrainz database:
150+
- Album verification and correction
151+
- Artist name standardization
152+
- Track title validation
153+
- Compilation to original album mapping
131154

132-
### 1. Automated Rewrite Rules (Fast Pattern Matching)
133-
These rules use regex patterns and literal string replacement to handle common formatting issues:
155+
#### 3. AI-Powered Cleaning (Optional)
156+
OpenAI integration for complex metadata issues:
157+
- Context-aware typo correction
158+
- Artist name disambiguation
159+
- Complex collaboration formatting
160+
- Pattern detection for new rules
134161

135-
**Remaster Removal**:
136-
- `Song Name - 2019 Remaster``Song Name`
137-
- `Song Name (Remaster 2019)``Song Name`
138-
- `Song Name (Remaster)``Song Name`
162+
## Development
139163

140-
**Featuring Normalization**:
141-
- `Artist ft. Other``Artist feat. Other`
142-
- `Artist featuring Other``Artist feat. Other`
164+
### Building from Source
143165

144-
**Whitespace Cleanup**:
145-
- Removes trailing/leading spaces
146-
- Normalizes multiple spaces
166+
```bash
167+
git clone https://github.com/colonelpanic8/scrobble-scrubber
168+
cd scrobble-scrubber
147169

148-
**Custom Pattern Rules**:
149-
- Supports complex regex patterns with capture groups
150-
- Can target specific fields (track name, artist name, album name, album artist)
151-
- Configurable through JSON/TOML rule files
170+
# Build with default features
171+
cargo build --release
152172

153-
### 2. AI Provider (Complex Judgment-Based Cleaning)
154-
When enabled, the OpenAI provider has two key functions:
173+
# Build with all features including OpenAI
174+
cargo build --release --features full
175+
176+
# Run tests
177+
cargo test
178+
```
155179

156-
**Immediate Corrections** for complex issues requiring musical knowledge:
157-
- **Typo Correction**: Fixes spelling errors that don't match simple patterns
158-
- **Album Disambiguation**: Changes compilation albums to original album names
159-
- **Artist Standardization**: Resolves artist name variations (e.g., "The Beatles" vs "Beatles")
160-
- **Compilation Metadata**: Corrects album artist fields for various artists compilations
161-
- **Complex Collaborations**: Restructures complex featuring/collaboration formats
162-
- **Context-Dependent Decisions**: Uses musical knowledge to make informed corrections
180+
### Architecture
163181

164-
**Pattern Detection** for system improvement:
165-
- **Rule Suggestions**: Identifies recurring patterns that could be automated with new rewrite rules
166-
- **System Learning**: Helps evolve the automated rule system by spotting consistent issues
167-
- **Efficiency Optimization**: Converts manual fixes into automated patterns when possible
182+
- **`lastfm-edit`**: Core library for Last.fm API interactions
183+
- **Provider System**: Modular architecture for adding cleaning providers
184+
- **State Management**: SQLite-based tracking of processed scrobbles
185+
- **Action System**: Type-safe representation of metadata modifications
168186

169-
The AI provider uses function calling to both fix immediate issues AND suggest improvements to the automated rule system, creating a self-improving metadata cleaning pipeline.
187+
## Contributing
170188

171-
## Architecture
189+
Contributions are welcome! Please feel free to submit a Pull Request.
172190

173-
The scrubber uses the `lastfm-edit` library for all Last.fm interactions and implements:
191+
## License
174192

175-
1. **Track Iterator**: Uses `RecentTracksIterator` with timestamp-based stopping
176-
2. **State Tracking**: Maintains a set of seen tracks to avoid reprocessing
177-
3. **Rule Engine**: Modular system for adding new cleaning rules
178-
4. **Action System**: Structured approach to track/artist modifications
179-
# Linux app test
180-
# macOS ARM app test
193+
MIT License - see [LICENSE](LICENSE) file for details

0 commit comments

Comments
 (0)