Tracks with multiple artists
What is the problem you are facing?
Funkwhale doesn't handle multi-artist tracks correctly. For example:
- Add a track with the
ARTISTtag set to "Madeon (feat. Passion Pit)" or any artist compound.
- Observe the behavior: Funkwhale will create an entire new artist named "Madeon (feat. Passion Pit)" and display it besides the track in the web UI.
I propose we replace
Track.artists set of
TrackArtist, a model like this:
class Affiliation: MAIN = "main" FEATURED = "featured" COMPOSER = "composer" CONDUCTOR = "conductor" COMPILER = "compiler" REMIXER = "remixer" PRODUCER = "producer" _CHOICES = ( (MAIN, "Main"), (FEATURED, "Featured"), (COMPOSER, "Composer"), (CONDUCTOR, "Conductor"), (COMPILER, "Compiler"), (REMIXER, "Remixer"), (PRODUCER, "Producer"), ) class TrackArtist(models.Model): artist = models.ForeignKeyField(Artist, related_name="tracks", on_delete=models.CASCADE) track = models.ForeignKeyField(Track, related_name="artists", on_delete=models.CASCADE) affiliation = models.CharField( max_length=30, default=Affiliation.MAIN, choices=Affiliation._CHOICES ) class Meta: unique_together = (('artist', 'track'),)
and then extract information from tags and filenames (?), as appropriate:
ARTISTtag using a regular expression (
\s*\(?feat(?:uring)?\.?\s+((?:\w\s?)+)\)?$) and then split the rest by a few preset delimiters, setting
REMIXER: extracted from appropriate Vorbis and ID3 tags.
PRODUCER: not 100% sure how to handle these two, as there doesn't seem to be any standard.
It might also be a good idea to implement (sort of) tabs in artist pages, allowing the user to filter by tracks the artist produced, appeared in or remixed.
What are the possible drawbacks or issues with the requested changes?
This change is going to involve quite a lot of work, especially on the API, and some UI/UX changes on the frontend.
- More joins, resulting in worse performance overall unless we manually add a couple of indexes to the models.
- This would require a backfill (new
TrackArtist(affiliation=MAIN) = Track.artist) migration.
Related to: #215 (closed)
I also noted down a few things in the Matrix channel.