When I use Picard to tag my albums and a track is present in another album already uploaded the import is not done. Funkwhale skip the import of the track. I guess it detects the track ID and since it is already present in another album, it doesn't matter.
Designs
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related.
Learn more.
I went grepping through the code, and it looks like the only places doing a lookup in the model by mbid is actually the import code? If so, it would be quite straight forward to just change the mbid field to remove the unique constraint in the database, and augment the import code to do a few more checks when looking tracks up by mbid.
I found out about this issue as well, when investigating why some of my (in-place) imported albums are missing few tracks. For example I have these two albums from same artist:
Both of them overlap in couple of tracks, for example "The Closest Thing to Crazy", so these tracks has same MUSICBRAINZ_TRACKID tag provided by MB Picard tagger. I think tagging is correct (same track=same ID but different album) and I want to hear all the tracks if I decide to play either of these two albums in Funkwhale :)
Just adding snippet of related chat (funkwhale-troubleshooting) history:
sporiff: I wonder if it would be possible to take both the release id and recording id into account when importing/uploading music
Jiří Nováček: that sounds like correct approach to me, if that is possible to do...
cannabiscannibal: Or at the very least, allow an extra variable in the import command to say if you want the current way or that way. Variable options = happy users all around ;)
Eliot Berriot (he/him): the main blocking point is that we consider a musicbrainz ID to be unique on the Track model, so we should investigate potential breaking changes if we remove this constraint
Just adding another situation - this issue also comes up when importing albums that are different versions of eachother - i.e., Japanese release of albums vs the American release vs special editions (like Target or iTunes exclusive releases).
As mentioned above, if the unique constraint could (optionally?) be a combination of the track ID and the release ID, I think that would take care of the problem, allowing multiple releases / albums to contain the same track.
As mentioned above, if the unique constraint could (optionally?) be a combination of the track ID and the release ID, I think that would take care of the problem, allowing multiple releases / albums to contain the same track.
I think we'll go this way, I have to test how it affects existing stuff that may rely on the current unique constraint, but it should be mostly fine :)