After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 579754 - Add item rating to DBus interface
Add item rating to DBus interface
Status: RESOLVED FIXED
Product: banshee
Classification: Other
Component: Metadata
1.4.3
Other Linux
: Normal enhancement
: 1.x
Assigned To: Banshee Maintainers
Banshee Maintainers
: 560238 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-04-21 17:58 UTC by Oben Sonne
Modified: 2011-08-22 06:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to add item rating to the player engine dbus interface (1.59 KB, patch)
2009-04-21 18:01 UTC, Oben Sonne
reviewed Details | Review

Description Oben Sonne 2009-04-21 17:58:34 UTC
Banshee's DBus interface provides various controls (playback, volume, ...) and information retrieval (song meta data). However, I really miss the possibility to rate items by the DBus interface.

I've written a patch that adds rating of an item as a writable property to the IPlayerEngineService. I'm not sure if this is the right place for that - it simply seemed most obvious to me.

With the given patch, rating now can be read and changed with DBus as follows:

org.bansheeproject.Banshee.PlayerEngine.GetRating()
org.bansheeproject.Banshee.PlayerEngine.SetRating(int)

I've tested this with file based items - works :)
But it does not work with radio stations :( their rating seems to be saved differently than file based items.

The patch is against the source tarball 1.4.3, because the current trunk version (rev. 5209) failed to build on my system.

This is my first Banshee patch - no idea if my approach is the right one, comments and improvements are welcome.

Regards,
Oben
Comment 1 Oben Sonne 2009-04-21 18:01:30 UTC
Created attachment 133060 [details] [review]
patch to add item rating to the player engine dbus interface
Comment 2 Oben Sonne 2009-05-03 18:29:20 UTC
Would be happy about some feedback. If the patch is not suitable to be integrated in the Banshee code, I would be glad to improve it .. just need a kind of response/mentoring :)
Comment 3 Alexander Kojevnikov 2009-05-13 01:25:47 UTC
*** Bug 560238 has been marked as a duplicate of this bug. ***
Comment 4 Gabriel Burt 2009-05-14 18:03:55 UTC
Hrm, it doesn't seem idea to have this in the PlayerEngineService, though it is the easiest way to add it atm, since we don't export actual Track objects we could have the method/property on.  Aaron, Alexander, Bertrand: thoughts?
Comment 5 Alexander Kojevnikov 2009-05-15 02:26:18 UTC
I'm not that much familiar with D-Bus and its best practices, however placing the Rating property to the PlayerEngine object seems a bit awkward to me. We should probably expose the currently playing track as a separate object containing all the usual track properties including the rating.
Comment 6 mstrelan 2009-12-30 04:13:49 UTC
Any further thoughts on this? As a user I would prefer if it works rather than the semantics of how it works.
Comment 7 Oben Sonne 2009-12-30 16:11:49 UTC
I agree with mstrelan, a not perfect but working solution is better than nothing.

Additionally I think it is not that awkward to have a rating property in the PlayerEngine: "Rate what's currently played" is IMHO a more common use case than "Rate a specific track from the library".
Comment 8 Jean-Lou Dupont 2009-12-30 21:38:43 UTC
I see 2 use cases:
1) Rate what is playing now
2) Exchange playlist/track info between media players 

#1 is pretty self explanatory. 
#2 would be used in case where a one wishes to transfer his/her music library from/to Banshee to/from X.

As a user, I'd like both.
Comment 9 Oben Sonne 2010-01-03 15:14:37 UTC
The attached patch matches use case #1. For use case #2, the CollectionIndexer DBus interface seems to be the right place, but AFAIK track meta data is read-only here too.

@banshee-developers:
Given the last posts, any new thoughts on including the patch as a quick-fix to adjust rating via DBus?
Comment 10 Alexander Kojevnikov 2010-01-20 09:35:58 UTC
I committed a slightly modified version of the patch, thanks Oben!
Comment 11 Alexander Kojevnikov 2010-01-20 10:06:08 UTC
I also added --set-rating=RATING command line option. You will need dbus-sharp installed from source to use it though, see bug 541279.
Comment 12 Oben Sonne 2010-01-22 15:11:57 UTC
Great, thank you!
Comment 13 Philip Gillißen 2011-08-22 06:50:31 UTC
I'm sorry that I have to push this bug, but I'm afraid that the --set-rating=RATING command line option is not documented in the manpage.
I wanted to add it in the current git head, but I didn't find the manpage definition.
It would be very helpful, if this command line option would be documented in the manpage.