/
/
# What does this implement/fix? A track is written to the library before its artist links are, and that write is never rolled back. If the sync is interrupted in between — a provider reload or a shutdown cancelling it — the track is committed without any artist at all. Nothing could repair that afterwards. The track still shows up in the library and opens fine, so it looks healthy, but it fails when you try to play it. The sync skips it on every later run because its change detection only looks at provider mappings and the date added, and the duplicate-track pass can't see it either because that needs the artist links it is missing. The sync already repairs a track that lost its album this way. This adds the same repair for a missing artist. #5845 stops one way a track can lose its artists; this repairs the tracks that already have none. **Related issue (if applicable):** - n/a ## 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` Changes: - Track the presence of artist links alongside the existing album check in the sync's lightweight library snapshot - Update an existing library track when the provider lists artists but the library row has none - Tests covering the new artist backfill, the existing album one, and that an intact track is not rewritten on every sync ## 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.