abarisain / dmix

A modern MPD Client for Android.
Apache License 2.0
591 stars 198 forks source link

support for mpd sticker command and hence add ability to rate songs #868

Open mbhangui opened 4 years ago

mbhangui commented 4 years ago

mpd has a support for maintaining extra meta tags for songs in a separate database called the sticker database. One can store the ratings for songs on a scale of 1 to 10. It can be enabled by having the line

#
# The location of the sticker database.  This is a database which
# manages dynamic information attached to songs.
#
sticker_file                    "/var/lib/mpd/sticker.db"

mpd also provides api to get and set the rating. e.g.

# get the rating for a single song
$ mpc sticker 'Dave Brubeck/Gone with the Wind - 1959/05 - B1 Camptown races (S.Foster).flac' get rating
rating=6

# get the rating for songs in an entire directory
$ mpc sticker 'Dave Brubeck/Gone with the Wind - 1959' find rating
Dave Brubeck/Gone with the Wind - 1959/01 - A1 Swanee River (S. Foster).flac: rating=6
Dave Brubeck/Gone with the Wind - 1959/02 - A2 The lonesome road (G. Austin, N. Silkret).flac: rating=6
Dave Brubeck/Gone with the Wind - 1959/03 - A3 Georgia on my mind (S. Gorrell, H. Carmichael).flac: rating=6
Dave Brubeck/Gone with the Wind - 1959/04 - A4 Camptown races (S.Foster).flac: rating=6
Dave Brubeck/Gone with the Wind - 1959/05 - B1 Camptown races (S.Foster).flac: rating=6
Dave Brubeck/Gone with the Wind - 1959/06 - B2 Short'nin bread.flac: rating=6
Dave Brubeck/Gone with the Wind - 1959/07 - B3 Basin street blues (S.Williams).flac: rating=6
Dave Brubeck/Gone with the Wind - 1959/08 - B4 Ol' man river (O.Hammerstein II, J. Kern).flac: rating=6
Dave Brubeck/Gone with the Wind - 1959/09 - B5 Gone with the wind (H. Magidson, A. Wrubel).flac: rating=6

A player like cantata supports this and hence allows the user to rate the songs on a scale of 1 to 5. When a user rates a song on a scale of 1 to 5, it doubles the value and submits it to mpd using the mpd sticker uri set command. e.g. this is how it looks in cantata.

image

Can we have the same feature in dmix? I believe there is not a single android client that supports the ability to rate songs in mpd. I believe most users don't even know about the mpd sticker feature.