I'd like to set the 'rating' of a specific track (i.e. not only the one currently playing) on Banshee through the DBus interface?
3 Answers
Banshee does not expose rating functions via DBus.
You can quickly view all functions that it exposes, using applications like d-feet[1]. Make sure that an instance of the application you are interested in (like Banshee in this case) is running.
There is a bug report already requesting to add rating functionality[2] to DBus interface. You might want to subscribe to it.

- 6,442
- 5
- 24
- 16
-
The referenced bug is fixed in Banshee 1.5.3. – Oben Sonne Feb 12 '10 at 16:54
Banshee does support rating via commandline since last year.
banshee --set-rating={1;2;3;4;5}
See the bug report for more options: Add item rating to DBus interface

- 23,388
- 27
- 97
- 146
Sadly the developer have not implemented a GET method, so there is no common way to execute "rate current track 1 star up/down"-command, much less than a specific track. Does anyone has written a script which provide this feature? Yet, I haven't found any solution to modify the D-Bus Property via command line. Finally here is my Workaround for rate the current played Track.
#!/bin/bash
#read current TrackRating
R=$(qdbus org.mpris.MediaPlayer2.banshee /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadata | grep 'userRating' | tr -d '/xesam:userRating: ')
case $R in
'' ) R=0 ;;
'0.2' ) R=1 ;;
'0.4' ) R=2 ;;
'0.6' ) R=3 ;;
'0.8' ) R=4 ;;
'1' ) R=5 ;;
esac
case $1 in
'inc' ) [ $R -lt 5 ]
banshee --set-rating=$(($R+1)) ;;
'dec' ) [ $R -gt 0 ]
banshee --set-rating=$(($R-1)) ;;
'res' ) banshee --set-rating=3 ;;
'min' ) banshee --set-rating=0 ;;
'max' ) banshee --set-rating=5 ;;
esac
Options:
- inc -> increase rating by one if possible
- dec -> decrease rating by one if possible
- res -> reset rating to three stars
- min -> set rating to zero stars
- max -> set rating to five stars
As far Banshee will not provide manipulating data of a specific Track this is my best bet.

- 272
- 4
- 12