[PATCH] Listitem.ratingpercent
#1
I was wondering if someone could check out the changes I've made to this please? I'm not the strongest coder in the world so any suggestions would be appreciated. Thanks.

http://www.xbmc.org/trac/ticket/7211
Reply
#2
Don't want to invade your trac ticket but what jmarshall said reminded me of a similiar issue with a movie's running time:
Quote:Isn't the real problem here that the ratings scales from different scrapers are, well, different?

Seems to me that storing them in a uniform manner would be a better way to go than for skinners to have to know which one they should use?

Different scrapers are filling ListItem.Duration inconsistently. Sometimes it has the minute unit stored with it, sometimes not.
'123 min' vs '123'
Reply
#3
Okay, I've finally figured out how to parse the
Code:
<rating="foo">
value in the scraper, but I was hoping to confirm before I go further that this is the correct method

Code:
int max_value = 10;
  const TiXmlElement* rElement = movie->FirstChildElement("rating");
  if (rElement && (rElement->QueryIntAttribute("max", &max_value) == TIXML_SUCCESS) && max_value>=0 && max_value<=1000)
  {
    CLog::Log(LOGERROR, "Woot! Rating Max Value is %i", max_value);
  }

Thanks.
Reply
#4
Looks fine, but I see little point in having a maximum allowed value for it Smile
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#5
jmarshall Wrote:Looks fine, but I see little point in having a maximum allowed value for it Smile

I can take that out, I was just thinking it wouldn't likely go over 100, but didn't want to put too much of a restriction on it. I'll leave the minimum and get rid of the maximum, thanks.
Reply
#6
Patch has been updated on trac and is now capable of this:

Image

Rating returned as percentage ("listitem.ratingpercent") and "Tomatometer" using progress control in combination with "listitem.ratingpercent"

Might not seem like much but believe me I pulled a lot of hair out! Laugh
Reply
#7
Changed on trac to exclude ratingpercent stuff for the moment, only including the normalisation of ratings to a scale of 1-10.
Reply
#8
Thanks to spiff and jmarshall for the help so far Smile

Very pleased to see the first part of my first patch accepted into XBMC.
Reply

Logout Mark Read Team Forum Stats Members Help
[PATCH] Listitem.ratingpercent0