mopidy / mopidy-mpd

Mopidy extension for controlling playback from MPD clients
https://mopidy.com/ext/mpd/
Apache License 2.0
98 stars 20 forks source link

Add multiple Artist tags for track with multiple artists #44

Closed splintersuidman closed 3 years ago

splintersuidman commented 3 years ago

Currently, mopidy-mpd creates the artists tag by concatenating the artists of a track, separated with a semicolon. For context, this happens in this line:

https://github.com/mopidy/mopidy-mpd/blob/1ab15a0c6b34a6cfb32674fa0b6f867decf6d8cf/mopidy_mpd/translator.py#L45

The MPD protocol documentation states:

There can be multiple values for some of these tags. For example, MPD may return multiple lines with a performer tag. A tag value is a UTF-8 string.

The same seems to be true for the artist tag. I tried the following code (which is basically inlining concat_multi_values but without the join):

    result = [
        ("file", track.uri),
        ("Time", track.length and (track.length // 1000) or 0),
        ("Album", track.album and track.album.name or ""),
    ] + [
        ("Artist", getattr(a, "name"))
        for a in track.artists
        if getattr(a, "name", None) is not None
    ]

And it worked just fine; in ncmpcpp the artists are shown separated by |.

So I wonder: why are the artists' names concatenated and is a single artist tag used, instead of an artist tag for every artist of the track?

I would rather have one tag per artist, since that would work better with my scrobbling setup.

Is it possible to change this behaviour? If so, I’d be happy to implement it and open a pull request. I think the same can be done for the composer and performer tag.

djmattyg007 commented 3 years ago

It could be for historical reasons, or it could be that some MPD clients used by some of the maintainers don't properly support this behaviour. If you are going to submit a PR, it might be worth having a config setting to control the new behaviour.

jodal commented 3 years ago

This probably has roots all the way back in late 2009/early 2010 when most of the MPD implementation was written. If the protocol docs say so and the popular clients support it, I'm all for changing this.

baloe commented 1 year ago

Oh I am so craving for an MPD client that actually does support multiple album artists, is there one?