Summary: | [PATCH] rating is a float in amarok and an integer in dbus | ||
---|---|---|---|
Product: | [Applications] amarok | Reporter: | kakashizilla |
Component: | Collections/Local | Assignee: | Amarok Developers <amarok-bugs-dist> |
Status: | RESOLVED INTENTIONAL | ||
Severity: | normal | CC: | karaluh, kfunk, maximilian.kossick, mitchell, psychonaut |
Priority: | NOR | ||
Version: | 2.3-GIT | ||
Target Milestone: | 2.4.0 | ||
Platform: | Fedora RPMs | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
kakashizilla
2009-10-25 14:38:58 UTC
true, I can confirm this. Not sure how to CC for this. I had a short look into this. internally Amarok is using the 0 <= rating <= 10 version of storing the rating. But trough dbus it tries to export the rating trough a float value which obviously dbus doesn't like and converts it to an int. et voilĂ you got a rounded value. There a two possibilities as far as I see it. Output the 0 <= rating <= 10 version or output the rating in a way that dbus likes. Rating is in the collection, I subscribe both Jeff and Max, let the developers decide :) It's an easy fix. Not sure if it breaks other stuff, though. Please check, I am not committing this. diff --git a/src/meta/MetaUtility.cpp b/src/meta/MetaUtility.cpp index 5d1bcf2..e6e2d67 100644 --- a/src/meta/MetaUtility.cpp +++ b/src/meta/MetaUtility.cpp @@ -127,7 +127,7 @@ Meta::Field::mprisMapFromTrack( const Meta::TrackPtr track ) map["genre"] = track->genre()->name(); map["comment"] = track->comment(); - map["rating"] = track->rating()/2; //out of 5, not 10. + map["rating"] = track->rating() / 2.0; // out of 5, not 10. Return float (bug 211777). if( track->year() ) map["year"] = track->year()->name(); So, is there anybody who wants to test that fix? *** Bug 257609 has been marked as a duplicate of this bug. *** Actually a WONTFIX, MPRIS standard tells us to use integer values. See: http://xmms2.org/wiki/MPRIS_Metadata#.22rating.22 "rating" (uint32) A "taste" rate value, out of 5. 0-5 or 1-5? Hint: You might want to use MPRIS v2.0 which uses the [0.0-1.0] range. (In reply to comment #7) > Actually a WONTFIX, MPRIS standard tells us to use integer values. > > See: http://xmms2.org/wiki/MPRIS_Metadata#.22rating.22 > > "rating" > > (uint32) A "taste" rate value, out of 5. 0-5 or 1-5? WONTFIX what? > Hint: > You might want to use MPRIS v2.0 which uses the [0.0-1.0] range. Hint for who? WONTFIX: GetMetadata() won't return a float. We're following the MPRISv1 standard here HINT: For anyone using dbus to get ratings, please use the MPRISv2 interface. |