[Bug?] condition="System.IdleTime(xx)" won't accept variables as a value
#1
So I was trying to set a value for a timeout fade.

Code:
<animation type="Conditional" condition="System.IdleTime(10) + !Player.Caching" reversible="true">
works perfectly.

but when I try to make the time set-able, nothing I try works.
First I tried.
Code:
<animation type="Conditional" condition="System.IdleTime($INFO[Skin.String(OSDTimeoutTime)]) + !Player.Caching" reversible="true">
with
Code:
<onclick>Skin.SetNumeric(OSDTimeoutTime)</onclick>
it sets it fine (as seen in the guisettings.xml), and can be displayed as a label in Settings.xml, but not as a label in Videotype_List.xml (weird).
so I tried
Code:
<animation type="Conditional" condition="System.IdleTime(Skin.String(OSDTimeoutTime)) + !Player.Caching" reversible="true">
just in case, but nothing

so I then tried
Code:
<animation type="Conditional" condition="System.IdleTime($LOCALIZE[Skin.String(OSDTimeoutTime)]) + !Player.Caching" reversible="true">
doesn't work, displays random word when used as a label, in this case "Programs"

so I tried making a bunch of:
Code:
    <variable name="value_OSDTimeoutTime">
        <value condition="SubString(Skin.String(OSDTimeoutTime),60)">60</value>
        <value condition="SubString(Skin.String(OSDTimeoutTime),59)">59</value>
        <value condition="SubString(Skin.String(OSDTimeoutTime),58)">58</value>
        <value condition="SubString(Skin.String(OSDTimeoutTime),57)">57</value>
        <value condition="SubString(Skin.String(OSDTimeoutTime),56)">56</value>
        <value condition="SubString(Skin.String(OSDTimeoutTime),55)">55</value>
.......
        <value condition="SubString(Skin.String(OSDTimeoutTime),8)">8</value>
        <value condition="SubString(Skin.String(OSDTimeoutTime),7)">7</value>
        <value condition="SubString(Skin.String(OSDTimeoutTime),6)">6</value>
        <value condition="SubString(Skin.String(OSDTimeoutTime),5)">5</value>
        <value condition="SubString(Skin.String(OSDTimeoutTime),4)">4</value>
        <value condition="SubString(Skin.String(OSDTimeoutTime),3)">3</value>
        <value condition="SubString(Skin.String(OSDTimeoutTime),2)">2</value>
        <value condition="SubString(Skin.String(OSDTimeoutTime),1)">1</value>
        <value>15</value>
    </variable>
and then tested it in Videotype_List.xml as a label (<label>$VAR[value_OSDTimeoutTime]</label>), and it finally displayed a number (the correct number too), but when used as:
Code:
<animation type="Conditional" condition="System.IdleTime($VAR[value_OSDTimeoutTime]) + !Player.Caching" reversible="true">
again it didn't work, so I tried this
Code:
<animation type="Conditional" condition="System.IdleTime($LOCALIZE[$VAR[value_OSDTimeoutTime]]) + !Player.Caching" reversible="true">
and nothing again, just displays "Programs" as a label, and doesn't ever timeout.

So I guess I'm wondering is it just simply that you can't use a variable with System.IdleTime()? If so, the Wiki should be updated, it might save the next sucker some trouble. Is it supposed to work? Am I doing something wrong?
Using a NUC7PJYHN and a 2820FYKH0 Intel NUC running LibreELEC, and two FireTVs.:)
Reply
#2
You can't use $INFO (or $VAR, $LOCALIZE, ...) in boolean conditions.
Image
Reply
#3
It works with SubString(), why not System.IdleTime()? (not the $'s in boolean condition but System.IdleTime(Skin.String(OSDTimeoutTime)) )
I was trying everything, I'm not surprised that some things aren't going to work, but why does one work fine, and the other fails?
Using a NUC7PJYHN and a 2820FYKH0 Intel NUC running LibreELEC, and two FireTVs.:)
Reply
#4
Your right, scratch my comment. It doesn't work because the string simply gets converted to an integer in GUIInfoManager.cpp. I'll have a look at it tomorrow.
Image
Reply
#5
Basically only a few "functions" take in info labels. Stuff like substring and the like designed to test strings.

Other stuff doesn't - it takes in set values and that's it.
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

Logout Mark Read Team Forum Stats Members Help
[Bug?] condition="System.IdleTime(xx)" won't accept variables as a value0