Hi everyone,
I am currently in the process of generalizing different aspects of a skin i am making. At this point, i have an image with a variable texture, that displays a "star rating" given different rating values. Now this works fine, as i am getting ratings from IMDB and the variable returns the highest "star rating" for a rating of 9 or higher. The variable looks as follows:
<variable name="star_var">
<value condition="Integer.IsGreaterOrEqual(ListItem.Rating,9)">rating/5.png</value>
<value condition="Integer.IsGreaterOrEqual(ListItem.Rating,8)">rating/4.5.png</value>
<value condition="Integer.IsGreaterOrEqual(ListItem.Rating,7)">rating/4.png</value>
<value condition="Integer.IsGreaterOrEqual(ListItem.Rating,6)">rating/3.5.png</value>
<value condition="Integer.IsGreaterOrEqual(ListItem.Rating,5)">rating/3.png</value>
<value condition="Integer.IsGreaterOrEqual(ListItem.Rating,4)">rating/2.5.png</value>
<value condition="Integer.IsGreaterOrEqual(ListItem.Rating,3)">rating/2.png</value>
<value condition="Integer.IsGreaterOrEqual(ListItem.Rating,2)">rating/1.5.png</value>
<value condition="Integer.IsGreaterOrEqual(ListItem.Rating,1)">rating/1.png</value>
<value condition="Integer.IsGreaterOrEqual(ListItem.Rating,0)">rating/0.5.png</value>
<value>rating/0.png</value>
</variable>
The problem is if a user gets ratings from a service other than IMDB (unless that service has ratings from 0 to 10). Now i could specify the service by using ListItem.Rating[(imdb)], and only fetch the IMDB rating - but will this not return 0 if the user has not scraped the IMDB rating?
If this is the case, i was hoping some of you would have som insight for how i should solve this.
Thanks in advance!
Anders,
I am currently in the process of generalizing different aspects of a skin i am making. At this point, i have an image with a variable texture, that displays a "star rating" given different rating values. Now this works fine, as i am getting ratings from IMDB and the variable returns the highest "star rating" for a rating of 9 or higher. The variable looks as follows:
<variable name="star_var">
<value condition="Integer.IsGreaterOrEqual(ListItem.Rating,9)">rating/5.png</value>
<value condition="Integer.IsGreaterOrEqual(ListItem.Rating,8)">rating/4.5.png</value>
<value condition="Integer.IsGreaterOrEqual(ListItem.Rating,7)">rating/4.png</value>
<value condition="Integer.IsGreaterOrEqual(ListItem.Rating,6)">rating/3.5.png</value>
<value condition="Integer.IsGreaterOrEqual(ListItem.Rating,5)">rating/3.png</value>
<value condition="Integer.IsGreaterOrEqual(ListItem.Rating,4)">rating/2.5.png</value>
<value condition="Integer.IsGreaterOrEqual(ListItem.Rating,3)">rating/2.png</value>
<value condition="Integer.IsGreaterOrEqual(ListItem.Rating,2)">rating/1.5.png</value>
<value condition="Integer.IsGreaterOrEqual(ListItem.Rating,1)">rating/1.png</value>
<value condition="Integer.IsGreaterOrEqual(ListItem.Rating,0)">rating/0.5.png</value>
<value>rating/0.png</value>
</variable>
The problem is if a user gets ratings from a service other than IMDB (unless that service has ratings from 0 to 10). Now i could specify the service by using ListItem.Rating[(imdb)], and only fetch the IMDB rating - but will this not return 0 if the user has not scraped the IMDB rating?
If this is the case, i was hoping some of you would have som insight for how i should solve this.
Thanks in advance!
Anders,