> ## Documentation Index
> Fetch the complete documentation index at: https://docs.clickwheel.fm/llms.txt
> Use this file to discover all available pages before exploring further.

# Repair metadata

> Fix album artists, fetch art, year, and genres, in place.

`fix` repairs your library's metadata so albums group correctly and show art on
the iPod. It writes back to your files **in place**, never moving or renaming
them (other tools like Plex read the same files, so paths stay stable).

```bash theme={null}
clickwheel fix            # whole library
clickwheel fix "Nirvana"  # just one artist
```

A run reports what it touched and skips anything the catalog already knows is
complete:

```text theme={null}
fix: 642 albums in catalog
  albumartist  ·  repaired 18
  musicbrainz  ·  art +27  year +14   (cached: 601)
  genres       ·  tagged 33           (cached: 596)
done · 0 files moved
```

## What it does

A three-step pipeline:

1. **Repair album artist**: so compilations and multi-artist albums group
   correctly.
2. **MusicBrainz**: fetch missing cover art and release year.
3. **Last.fm**: fetch genres (needs a Last.fm API key).

All three steps are index-driven (no filesystem walks for already-clean state)
and cache both positive *and* negative results in SQLite, so re-running on an
unchanged library does **zero** network work. It all runs on the base install,
no extra packages required.

The genre step uses the same Last.fm API key as
[scrobbling](/guides/scrobbling) (read-only, no `--auth` required). Without it,
genres are skipped with a warning and the other steps still run.

## Refreshing

Cached results are reused on every run. To force a re-fetch:

```bash theme={null}
clickwheel fix --refresh-mb        # re-fetch MusicBrainz art/year
clickwheel fix --refresh-genres    # re-fetch Last.fm genres
```
