spl0k / supysonic

Supysonic is a Python implementation of the Subsonic server API.
https://supysonic.readthedocs.io
GNU Affero General Public License v3.0
259 stars 57 forks source link

Multiple artist albums have only 1 track #254

Closed ianesten closed 11 months ago

ianesten commented 1 year ago

When using the random albums api call, if an album with multiple artists is chosen, it will only have 1 track in it. When using the search api call and searching for an album title that has multiple artists, instead of a single album supysonic will return an album with a single track for each unique artist on the album.

ianesten commented 1 year ago

If it matters, the client is AVSub. This does not happen with subsonic.

ianesten commented 1 year ago

I think I see the problem. In Scanner.__find_album, albumartist is passed in as an argument. This is used to retrieve an Artist object, which is then queried for a list of albums. This means that for tracks in a multiple artist album to be grouped together, the album artist tag must be set, if not Scanner will generate multiple album objects for a single various artists album. This is different behaviour to subsonic, which will fall back to looking at the directory an audio file is in. Could this be adopted for supysonic as well?

ianesten commented 1 year ago

See https://github.com/sindremehus/subsonic/blob/master/subsonic-main/src/main/java/net/sourceforge/subsonic/dao/AlbumDao.java#L67 for subsonic behaviour.

spl0k commented 11 months ago

Hello. As you might have guessed, tracks from a various artist release will only be grouped under the same album if their album artist metadata field is properly set. Following Subsonic's behaviour might introduce some inconsistencies such as compilations where each track is from a different artist would be listed as an album of a random artist in this compilation. This might be cumbersome but I'd rather have the current behaviour rather than trying to be lenient and having the possibility to produce results that would be incorrect.