/
/
# What does this implement/fix? A library album could lose all of its artists. Updating an album with `overwrite=True` and an empty artist list cleared every stored artist relation for that album. You reach it by refreshing a track: a provider that hands the track a full album object without artists makes the track update overwrite that album's artist rows with nothing. Emby does this on every track, qqmusic on most. The album then shows no artist, drops out of the artist's discography, and is silently skipped by provider matching from that point on, so it cannot repair itself. This is the artist half of a wider problem: the same refresh also replaces the album's year, genres, images, barcode and cross-provider links with whatever the stub album carries, which is usually nothing. That part is tracked separately in #5853. Unlike tracks, an album with no artists is a legitimate state (albums added from an item mapping start out that way), so this only refuses to *clear* artists — it never requires them. Same hole that #5845 closed for tracks and #5548 for provider mappings. Also fixes a nearby crash waiting to happen: the album matcher read `artists[0]` without checking, which would raise on any album that has no artists. Not reachable today (the caller happens to guard first), but the same method 240 lines up already handles this, so the two now agree. ## Changes - An overwrite update that carries no artists now keeps the stored ones instead of clearing them, and logs a warning so the attempt is visible. - The album matcher searches on the album name alone when the album has no artists. - Added tests for the refusal, a normal artist replacement, the track-refresh path that triggered it, and both search-string forms. ## Types of changes - [ ] Bugfix (non-breaking change which fixes an issue) — `bugfix` - [ ] New feature (non-breaking change which adds functionality) — `new-feature` - [ ] Enhancement to an existing feature — `enhancement` - [ ] New music/player/metadata/plugin provider — `new-provider` - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) — `breaking-change` - [ ] Refactor (no behaviour change) — `refactor` - [ ] Documentation only — `documentation` - [x] Maintenance / chore — `maintenance` - [ ] CI / workflow change — `ci` - [ ] Dependencies bump — `dependencies` ## Checklist - [x] The code change is tested and works locally. - [x] `pre-commit run --all-files` passes. - [x] `pytest` passes, and tests have been added/updated under `tests/` where applicable. - [ ] For changes to shared models, the companion PR in `music-assistant/models` is linked. - [ ] For changes affecting the UI, the companion PR in `music-assistant/frontend` is linked. - [x] I have read and complied with the project's [AI Policy](https://github.com/music-assistant/.github/blob/main/AI_POLICY.md) for any AI-assisted contributions. - [ ] I have [raised a PR against the documentation repository](https://github.com/music-assistant/music-assistant.io/blob/main/CONTRIBUTING.md) targeting the main or beta branch as appropriate.