Funkwhale unable to import Albums with multiple Artists
When importing an album with tracks from different artits I get the following message:
- $file: IntegrityError duplicate key value violates unique constraint "music_album_mbid_b09e59fe_uniq"
As an example this album https://musicbrainz.org/release/ecd0f299-e5c9-441d-bede-0962280df413 fails on the Tracks from Plan 9 and Enya (eg: https://musicbrainz.org/recording/94ab07eb-bdf3-4155-b471-ba1dc85108bf).
My guess is the following is happening:
- Funkwhale imports the first track from the album, creating the album with the album-title and the artist from that track.
- Funkwhale continues importing until reaching to a track from a different artist.
- Due to the different artist, Funkwhale tries to create a new album with the album-title and the artist from that track.
- This fails due to the MB-Id being different
To fix this Funkwhale should read the "release artist" (or "album artist") from the track and use that one to create the Album (and put tracks in it) instead of using the tracks artist.