Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple artist support #2524

Open
wants to merge 92 commits into
base: master
Choose a base branch
from
Open

Conversation

certuna
Copy link
Contributor

@certuna certuna commented Sep 16, 2023

Closes #238 and #277

Adds support for multiple artists. There are three commonly used methods to tag these, this PR support all three:

  1. Using the official multi-artist support in tags: null-separated strings in id3v2.4 (Jay-Z<null>Kanye West), multiple ARTIST fields in FLAC/MP4 (ARTIST = Jay-Z, ARTIST = Kanye West)
  2. Single string with non-standard separator, usually semicolon: ARTIST = Jay-Z;Kanye West
  3. ARTISTS/ARTIST method used by MusicBrainz Picard: multi-valued ARTISTS (Jay-Z<null>Kanye West), singlevalued ARTIST (Jay-Z & Kanye West) for backwards compatibility

How this PR works in the Navidrome DB mediafile and album tables:

  • artist and album_artist are formed by concatenating multiple artists: Jay-Z · Kanye West
  • artist_id is populated with the id of the first artist 0e37575446e8659caa9f2a3e298afc86, i.e. clicking on Jay-Z · Kanye West will take you to the artist page of Jay-Z
  • all_artist_ids has the ids of all artists: 0e37575446e8659caa9f2a3e298afc86 0b48849166b97b6b053a0e1e5e131231, this makes the songs/albums show up in the artist discography
  • all artist names added to full_text, so available for search

Three new config options (we can drop some of them if we deem them good enough to stay enabled all the time):

  • Scanner.MultipleArtists (default true): if false, only the first artist in the tags is used.
  • Scanner.ArtistSeparators (default ;): just like Scanner.GenreSeparators
  • Scanner.RemixerToArtist (default true): this does what Spotify does: reads the Remixer tag and treats it as an additional Artist.

I've been testing this for over three months now, it's pretty solid. Open issues:

Dependencies/conflicts

Artist discography sorted own-albums-first #2580 is not strictly necessary but if we don't do it the discographies of artists with lots of compilation tracks and guest appearances/collabs will become a mess
Create artist objects for non-Album Artists #2583 is not strictly necessary but allows users to browse artists that have no albums but a lot of compilation tracks or guest appearances/collabs
Split albums by MusicBrainz Album ID #2538 is independent but conflicts with one line in scanner/mapping.go
refactor GetFullText() #2587 is independent but has conflicts

Subsonic clients

Mainly around "Go to {track artist}" functionality, where you can navigate to the artist of a song. None of them are showstoppers in my opinion. I've been cross-referencing the behaviour with LMS, another Subsonic server that supports multiple artists.

  • Substreamer: works as expected, with s small cosmetic hiccup:if you Go To Artist Jay-Z · Kanye West, it takes you to Jay-Z's discography, but still displays the Jay-Z · Kanye West artist name - probably only needs a small fix on the Substreamer side to refresh the artist name after the clickthrough. For comparison, LMS does not provide an ArtistID for tracks with multiple artists, so Go To Artist isn't possible at all
  • Play:Sub: Go To Artist gives an error, with both Navidrome and LMS. Seems it doesn't use the ArtistID, but does a lookup for up the Artist Name Jay-Z · Kanye West, which fails in both cases
  • Amperfy: It displays the first artist, so it looks like it split on the middle dot clients side. Go To Artist works correctly, without errors. For comparison: when clicking Go To Artist, LMS gives API Error but does seem to load the discography.
  • Supersonic: no issues
  • Sonixd: no issues
  • Feishin: no issues
  • Other subsonic clients?

Web UI Cosmetics

Since the artistID of the track only links to the first artist, clicking on the Jay-Z · Kanye West link in the WebUI will always take you to the artist page of Jay-Z, ideally the WebUI would make this clearer to the user by only hyperlinking Jay-Z, not the other artists. It's mainly cosmetic, but if we dislike it enough, someone with more JavaScript skills than me would have to take a look a this. At the moment this PR is 100% serverside.

Screenshot 2023-06-16 at 14 08 49

Sort by Artist = Album Artist first, so it shows an artist's own albums first, and appearances on other albums second.
Alias match_album_artist, allows for sorting by an artist's own albums first, then his appearances on compilations/etc.
forgot args in line 89
removed comment about Subsonic, it's irrelevant since this query is never done through the Subsonic API.
updated with multi-artist tags
Add function to remove duplicate values but keep the order intact
Add test for RemoveDuplicateStr()
fix AlbumID()
tab screws up lint
@certuna
Copy link
Contributor Author

certuna commented Nov 5, 2023

Cleaned it all up, tests all clear, ready to merge I think. OpenSubsonic support is better done in a separate PR.

@RubenTeixeira
Copy link

Hey @certuna , thanks for your work.

I'm getting this when using this PR:

Nov 12 22:47:35 raspberrypi navidrome[16356]: time="2023-11-12T22:47:35Z" level=fatal msg="Failed to apply new migrations" error="error: found 1 missing migrations:\n\tversion 20230615000000: /github/workspace/db/migration/20230615000000_add_all_artist_ids_to_mediafile.go"

What is missing?

@certuna
Copy link
Contributor Author

certuna commented Nov 15, 2023

Hey @certuna , thanks for your work.

I'm getting this when using this PR:

Nov 12 22:47:35 raspberrypi navidrome[16356]: time="2023-11-12T22:47:35Z" level=fatal msg="Failed to apply new migrations" error="error: found 1 missing migrations:\n\tversion 20230615000000: /github/workspace/db/migration/20230615000000_add_all_artist_ids_to_mediafile.go"

What is missing?

Ah yes I'll fix this, there have been new additions to the codebase so my migration is outdated.

@RubenTeixeira
Copy link

Ah yes I'll fix this, there have been new additions to the codebase so my migration is outdated.

Thank you so much! Looking forward to trying it out :)

@certuna
Copy link
Contributor Author

certuna commented Nov 16, 2023

Ah yes I'll fix this, there have been new additions to the codebase so my migration is outdated.

Thank you so much! Looking forward to trying it out :)

Should work now. I don't know if this PR will be merged soon or if we wait until we can do it all together with OpenSubsonic API support.

@RubenTeixeira
Copy link

Should work now. I don't know if this PR will be merged soon or if we wait until we can do it all together with OpenSubsonic API support.

Yes it does! Looking good. Will keep happily testing and report if I find any incident.
Yeah I'm very excited for all the OpenSubsonic stuff. Can't wait :)

@kobayashi90
Copy link

approve this and make 0.50.2 happen..

@tty228
Copy link

tty228 commented Dec 21, 2023

The number of tracks for each individual singer in a choir cannot be displayed correctly at the moment. This issue is likely related to the fact that the artistID of a track is only linked to the first artist. Additionally, it would be great if hyperlinks could be selected for ensemble singers.
11111
2222
3333

@TacoCake
Copy link

TacoCake commented Jan 9, 2024

Hey, what's holding this PR back? Does it still need contributions?

@RubenTeixeira
Copy link

Hey, what's holding this PR back? Does it still need contributions?

Perhaps it's the fact that the author did not prepare support for OpenSubSonic API. It works great otherwise. I'm also looking forward for this.

@dweymouth
Copy link
Contributor

Hey, what's holding this PR back? Does it still need contributions?

From conversations on Discord it's that this PR kind of "hacks" around the existing DB schema, whereas Deluan now prefers to redesign the database schema "properly" for the many-to-many relationships between artists and albums. So this PR will likely get scrapped in favor of a larger-scale database redesign. But this is a good thing as doing it right at the database level will probably be more performant and enable future extensions more easily.

@TacoCake
Copy link

TacoCake commented Jan 9, 2024

Hey, what's holding this PR back? Does it still need contributions?

From conversations on Discord it's that this PR kind of "hacks" around the existing DB schema, whereas Deluan now prefers to redesign the database schema "properly" for the many-to-many relationships between artists and albums. So this PR will likely get scrapped in favor of a larger-scale database redesign. But this is a good thing as doing it right at the database level will probably be more performant and enable future extensions more easily.

Ah, I see, thanks for the info. Is there anywhere I can track this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support multiple artists, with custom separator
7 participants