sentriz / gonic

music streaming server / free-software subsonic server API implementation
ircs://irc.libera.chat/#gonic
GNU General Public License v3.0
1.54k stars 110 forks source link

support multiple artists #103

Closed raffomania closed 12 months ago

raffomania commented 3 years ago

If a track is a collaboration between multiple artists, gonic should be able to associate it with all of them in the DB - this would mean changing Track.Artist to Track.Artists, a many-to-many relationship. I can understand if this is too much work for you, but it would be really cool to remove "Artist X, Artist Y" entries from my artist list :)

If the subsonic API doesn't support this, you could just join the artist names again when delivering metadata to clients.

sentriz commented 3 years ago

not a bad idea 👍 i'm currently working on multiple genre support. so it would be a very similar setup

raffomania commented 3 years ago

awesome! love gonic so far, thanks a bunch for putting in all that hard work!

hildebro commented 3 years ago

Hey @sentriz,

I noticed that multiple genres support has been added on master some time ago. Since you mentioned it being similar to multiple artists, do you have any estimation on when we might see that?

Furthermore, when might we see both of these features released via AUR?

Thanks for your work!

sentriz commented 3 years ago

hey thanks for the nice words :)

the current priority is #108 , when that is merged i'll make a new release including some scanner fixes, listenbrainz, and podcasts support

after that i can consider multiple artists. hopefully it won't be too far away since it's something i'd like to use myself

TwistTheNeil commented 3 years ago

I already see that you mentioned scanner fixes, so not making a new issue. In a similar situation (unless this issue captures it already), if there are multiple artists, gonic seems to index a song with the last artist in the list which can be incorrect.

Example:

METADATA block #2
  type: 4 (VORBIS_COMMENT)
  comments: 17
    comment[0]: ALBUM=Death by Rock and Roll
    comment[1]: ARTIST=The Pretty Reckless
    comment[2]: ARTIST=Tom Morello
...
    comment[11]: TITLE=And So It Went (featuring Tom Morello)

The artist is The Pretty Reckless but is registered as Tom Morello

sentriz commented 2 years ago

Hello just as a small update I am still very into this. For me, implementing this make sense after beets implements this:

https://github.com/beetbox/beets/issues/1824

After that I think it could be a really nice feature

sentriz commented 1 year ago

this is getting close on the beets side by the look of things https://github.com/beetbox/beets/pull/4743

also there is a discussion about how the subsonic spec could be extended to better support this stuff here https://github.com/opensubsonic/open-subsonic-api/discussions/8

jmbannon commented 1 year ago

Any ideas for timeline on when you think multi-artist tags would be supported? I've been dreaming of a subsonic server that handles this for years.

One idea I've had on my mind for a while is tricking the current subsonic API to support multi-tags via serving albums/tracks/etc based on multi tags. I.e. GET artists/ would return all unique values in all artists multi tags. Then when you select an artist, you serve all albums/tracks that contain that artist in the multi-value. In addition, have support to either use artists or albumartists

sentriz commented 1 year ago

@jmbannon no timeline, but this is something that i would very much like too. i have started working on some of it already

and what you described is close to what i had in mind

just thinking out loud here:

if we we're to consider a sql schema, it could be a be many-to-many situation

create table artists (id int, name text);
create table albums (id int, name text);
create table artist_albums (artist_id int, album_id int);

so for an album Sniper by Alan Vega & Marc Hurtado we could have

artists:
- id=1 name="Alan Vega"
- id=2 name="Marc Hurtado"

albums:
- id=1 name="Sniper"

artist_albums:
- artist_id=1 album_id=1
- artist_id=2 album_id=1

here a "get artists" query lists all unique artists, like you said. a get an artist's albums query works like you'd expect too.

this is all possible to do right now (and thanks to your beets PR :+1:) but the only bit i'm not sure, where maybe some actual tricking may need to be done is -

what artist do we show to the user when we click the album that has id 1? we need to put some single value in the "albumartistid" field in the response. of course this is not an issue when we have the multi "albumartistids" field as described in that opensubsonic issue. but for clients that don't support it we need some value

jmbannon commented 1 year ago

what artist do we show to the user when we click the album that has id 1?

Is that used for navigation or just display? I think the best approach would be to return the single id of whichever artist you clicked on to find it in the first place. If searching by album/song/etc, you could just naively place the first album artist in there for now

sentriz commented 1 year ago

not just navigation or display but the whole data model. for example if a client makes the request getAlbum.view?id=1, we need to return some json that describes that album. one of the fields is a single artist ID, but we have 2 of them. with the extension we can return both, but for the current spec just 1.

that said, this is only for the schema that i described above - maybe there is a smarter way. not sure yet

for the meantime i will probably just pick a random artist ID or the first one that appears in the tags

jmbannon commented 1 year ago

Got it, yeah makes sense to have it map to all album artists behind the scenes, and the for current subsonic compatibility, just return the first one.

From what I've seen, the album artist ordering often reflects order of contribution to the album. Returning the first one would be best IMO

sentriz commented 1 year ago

things cooking up on the (experimental) multi-artist branch and a couple changes to airsonic-refix

out.webm

sentriz commented 12 months ago

hey, this can now be configured on master with GONIC_MULTI_VALUE_ALBUM_ARTIST

for example in my setup i have

GONIC_MULTI_VALUE_ALBUM_ARTIST="multi"
GONIC_MULTI_VALUE_GENRE="delim ;"
jmbannon commented 12 months ago

Amazing! Does genre support 'multi' ?

sentriz commented 12 months ago

jmbannon yes it does 👍 though I haven't tried it yet. I've only been testing albumartists so far, thanks to your work on beets 👌

sentriz commented 12 months ago

also, if your tags already had the multi value tags before gonic last saw them, youll need to do a full scan

afontenot commented 12 months ago

I'm failing to get this to work. Testing with a fresh gonic setup and airsonic-refix, I have the following in my config file:

multi-value-album-artist    multi

I'm using this album / track for testing. It's tagged with Picard using additional scripts I wrote to make sure the multi value tags are set correctly.

mutagen-inspect reports this

$ mutagen-inspect 01\ -\ There\'s\ No\ Leaving\ Now.flac | grep ARTISTS
ALBUMARTISTS=The Tallest Man on Earth
ALBUMARTISTS=yMusic
ARTISTS=The Tallest Man on Earth
ARTISTS=yMusic
ALBUMARTISTSORT=Tallest Man on Earth, The; yMusic
ARTISTSORT=Tallest Man on Earth, The; yMusic

full report: mutagen-inspect.txt

But in airsonic-refix, I see only the first artist in the part of the UI where each is individually clickable in your example video.

These files work in both Kodi and QuodLibet, which both support multi-valued tags. Maybe my tags contain something that is tripping up the new code in gonic?

Incidentally, if anyone knows a subsonic API client for web (or desktop Linux) that supports both this multiple artists feature and jukebox mode, I'd love to hear about it.

sentriz commented 12 months ago

But in airsonic-refix, I see only the first artist in the part of the UI where each is individually clickable in your example video.

that's right, it's a new feature of the subsonic spec so not all clients support it just yet

there is discussion ongoing here

for airsonic-refix, I opened a pull request to make that work here

afontenot commented 12 months ago

But in airsonic-refix, I see only the first artist in the part of the UI where each is individually clickable in your example video.

that's right, it's a new feature of the subsonic spec so not all clients support it just yet

Of course it would be something dumb like this on my part. :-) Thanks for working on this.

sentriz commented 12 months ago

no worries :grin: thanks!