multiple ratings (imdb, rt, etc)?
#1
I'm trying to add multiple ratings in movie list view. Here's what I've done:

1) To get some extra data in I added this to the nfo file:

Code:
        <rating name="Metacritic" max="100" default="false">
            <value>75</value>
            <votes>48</votes>
        </rating>

Then I did a refresh in Kodi hoping that'll update my data base.

2) declared a var:

Code:
<variable name="Metacritic">
        <value condition="!IsEmpty($INFO[ListItem.Rating(Metacritic)])">$INFO[ListItem.Rating(Metacritic)]</value>
    </variable>

3) display:

Code:
            <control type="label">
                <width>auto</width>
                <centertop>50%</centertop>
                <height>64</height>
                <align>left</align>
                <aligny>center</aligny>
                <label>$VAR[Metacritic]</label>
                <font>Flag</font>
                <textcolor>Dark1</textcolor>
                <visible>true</visible>
            </control>

I know the display code is fine because if I change the var to "10" it shows fine. Either $INFO[ListItem.Rating(Metacritic) isn't working or my nfo trick didn't work.

Any suggestions?
Reply
#2
When you see RT and metacritic ratings in skins they are using Skin Helper to get the ratings.

I have no idea if what you are doing is possible with nfo files or not (though I have a strong feeling that it is not). Nonetheless, with IsEmpty you don't wrap the infolabel in the $INFO[] tag. For instance, the correct syntax would be:
Code:
<value condition="!String.IsEmpty(ListItem.Rating(Metacritic))">$INFO[ListItem.Rating(Metacritic)]</value>

Also, note that IsEmpty is depreciated and replaced by String.IsEmpty -- both work in Krypton but only String.IsEmpty will work in Leia.
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#3
Thanks! Just started Kodi coding a couple of days ago, so still learning the ins and outs of the syntax.

That is now displaying a value, but it's displaying the default rating value, not the metacritic one. Reading the docs Krypon is supposed to support multiple ratings.

I didn't go down the SkinHelper path, because rotten tomatoes isn't supported anymore and I thought going via the Kodi db should be a good way forward....
Reply
#4
I know this was from months ago, but this recently cropped up again.

The issue was that for Krypton you have to use ListItem.Ratings(metacritic) with the "s" on the end of Ratings.
This has been fixed for Leia to be ListItem.Rating(metacritic)

Also ListItem.Ratings(metacritic) will not work outside of the info dialog.
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply

Logout Mark Read Team Forum Stats Members Help
multiple ratings (imdb, rt, etc)?0