Remove secondary artist recording from track imports #41
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description:
Currently, when a track has multiple artist credits on MusicBrainz (e.g., "Artist A feat. Artist B"), the tagger creates separate artist records in the DB for secondary/collaborating artists. This is done via
extract_secondary_artists()inshanty-data/src/musicbrainz.rs, which walks the MusicBrainz artist credit array beyond the first entry and records non-"featuring" collaborators. Thesecondary_artistsfield onRecordingDetails(inshanty-data/src/types.rs) carries these through to the tagger inshanty-tag/src/tagger.rs, which then callsqueries::artists::upsert()for each secondary artist.This clutters the library with artists that the user didn't intentionally add — they show up in the library view, artist list, Subsonic browsing, and playlist artist picker.
What to change
shanty-data/src/musicbrainz.rs: Remove theextract_secondary_artists()function entirely. Remove the call to it in theget_recording()method (in theMetadataFetcherimpl).shanty-data/src/types.rs: Remove thesecondary_artists: Vec<(String, String)>field from theRecordingDetailsstruct.shanty-tag/src/tagger.rs: Remove any code that iterates overrecording.secondary_artistsand creates artist DB records for them. The tagger should only create/upsert the single primary artist.shanty-tag/tests/integration.rsandshanty-watch/tests/integration.rs: Update any test mocks that setsecondary_artistsonRecordingDetails— change tosecondary_artists: vec![]or remove the field entirely after the struct change.Consider a cleanup migration or manual SQL: Existing secondary artist records in the DB won't be automatically removed. Either add a migration that deletes artists with no wanted items and no tracks, or document a manual cleanup query.
Acceptance criteria:
extract_secondary_artists()removed from musicbrainz.rssecondary_artistsfield removed fromRecordingDetails