rust-mpd
rust-mpd copied to clipboard
Allow tags with multiple values
Tags in MPD are not a key-value mapping, but an array of key-value pairs. Some tags commonly have multiple values, such as PERFORMER, and by storing this data in a map we only get one of the performers.
@SimonPersson I don't think this is enough to solve the problem, as most commands are parsed using read_structs
which uses an iterator over Maps
built from the pairs, which uses BTreeMap
as items.
See:
https://github.com/kstep/rust-mpd/blob/17a4394ddd64e0e8b43d3fbbbe624d2bd04cccb0/src/client.rs#L205-L207
https://github.com/kstep/rust-mpd/blob/17a4394ddd64e0e8b43d3fbbbe624d2bd04cccb0/src/proto.rs#L108
and https://github.com/kstep/rust-mpd/blob/17a4394ddd64e0e8b43d3fbbbe624d2bd04cccb0/src/proto.rs#L43-L47
@anddon - you are right! I only tested with currentsong
, which doesn't use read_structs
. I'll work on a fix.
@anddon - I think I fixed it!
Yes, it's working properly now, even for read_structs