Bug IsEmpty(ListItem.StarRating) never true
#1
To hide the star rating even if there's no rating available I have to use this -

PHP Code:
<visible>StringCompare(ListItem.StarRating,rating0.png) | StringCompare(ListItem.StarRating,rating1.png) | StringCompare(ListItem.StarRating,rating2.png) | StringCompare(ListItem.StarRating,rating3.png) | StringCompare(ListItem.StarRating,rating4.png) | StringCompare(ListItem.StarRating,rating5.png)</visible

instead of this -

PHP Code:
<visible>!IsEmpty(ListItem.StarRating)</visible

Surely that should work?
Reply
#2
The missing slash closing the visible tag is a typo ?
Reply
#3
Yes, corrected my post. Thanks.
Reply
#4
AFAIK that was not working. I use IsEmpty(ListItem.Rating) if i want to hide empty ratings (star or numbers).

Cheers
Nessus
Reply
#5
Not sure how to actually fix it, but here is something at least a bit more compact:

Code:
<visible>!SubString(Listitem.StarRating, rating)</visible>
Image
Reply
#6
That should be -

PHP Code:
<visible>SubString(Listitem.StarRating,rating)</visible

I did try that but for some unknown reason even that doesn't work.
Reply
#7
(2014-04-23, 21:19)Hitcher Wrote: That should be -

PHP Code:
<visible>SubString(Listitem.StarRating,rating)</visible

I did try that but for some unknown reason even that doesn't work.

Won't work as it looks like

<label>$INFO[ListItem.StarRating]</label>

is an empty string.
My skins:

Amber
Quartz

Reply
#8
According to wiki it should return 0-5.

Quote:ListItem.StarRating

Returns a value of 0 to 5 as a graphical display from images named rating0.png to rating5.png of the skin
Reply
#9
!IsEmpty(ListItem.StarRating) does work on the parent folder item.

EDIT: nvm that last part

EDIT2: okay on album level it doesnt return rating0.png if there's no rating and on song level it does. I knew there was a reason why i use fallback="rating0.png"
Reply
#10
(2014-04-24, 14:05)Hitcher Wrote: According to wiki it should return 0-5.

Quote:ListItem.StarRating

Returns a value of 0 to 5 as a graphical display from images named rating0.png to rating5.png of the skin

It sure is a bug Smile I just said why substring compare will not work.
My skins:

Amber
Quartz

Reply
#11
Note that there may be a difference between what is returned to a label and what is returned to an image - I dunno.

But either way, I'll need something a bit clearer in order to fix it (ideally a bit of skin code that allows simple reproduction 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
#12
Confluence > ViewMusicLibrary.xml

Add <visible>!IsEmpty(ListItem.StarRating)</visible> to the fadelabel control at line 443.

View your albums using the 'Fanart' viewmode - albums with no ratings will show no stars but the label 'Rating:' is still visible.

Thanks.
Reply
#13
As far as I can tell, ListItem.StarRating will return an empty string if there is no videoinfotag and no musicinfotag in the item. Otherwise it will return "rating0.png" through "rating5.png" based on the assigned rating.

i.e. it returns empty for the "All Albums" item and the parent directory item. But it won't return empty (rather "rating0.png") for anything that is rated 0.

I'm not sure if this is something that should be changed or not. It's easy enough to add a check for rating > 0 in there.

Opinions?

(In the meantime, if you hide it if it's empty or "rating0.png" you should get what you want)

Cheers,
Jonathan
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
#14
adding fallback="rating0.png" (for albums) is good enough for me, eg no change is needed.
Reply
#15
I've just had a look at my music database and I think the problem is some of my albums have a negative value for the rating field. There are also loads with nothing in this field (as opposed to zero) so does this mean there isn't a rating (which is why I'd like to hide that line altogether) or they are 0?

Thanks.
Reply

Logout Mark Read Team Forum Stats Members Help
IsEmpty(ListItem.StarRating) never true0