Kodi Community Forum
How do we use stringcompare for two labels? - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12)
+--- Thread: How do we use stringcompare for two labels? (/showthread.php?tid=98830)



How do we use stringcompare for two labels? - igotdvds - 2011-04-08

I need to do something like this:

Code:
stringcompare(Skin.String(Delete_Show_Number_1),ListItem.TVShowTitle)

Is this possible? I can get it to prove true if I set it to say:

Code:
stringcompare(Skin.String(Delete_Show_Number_1),Justified)

But I cant use an infolabel. Three hours later, I have no workaround. Anybody got an idea?


- Hitcher - 2011-04-08

The second string needs to be formatted differently so XBMC knows it's info and not just a string.

PHP Code:
stringcompare(Skin.String(Delete_Show_Number_1),$INFO[ListItem.TVShowTitle]) 



- igotdvds - 2011-04-08

Hitcher Wrote:The second string needs to be formatted differently so XBMC knows it's info and not just a string.

PHP Code:
stringcompare(Skin.String(Delete_Show_Number_1),$INFO[ListItem.TVShowTitle]) 

That doesnt work either.


- Hitcher - 2011-04-08

Have you checked they're both actually the same by using two separate labels on screen?
Either that or you need to add the container ID -

$INFO[Container(n).ListItem.Label]


- igotdvds - 2011-04-08

Hitcher Wrote:Have you checked they're both actually the same by using two separate labels on screen?
Either that or you need to add the container ID -

$INFO[Container(n).ListItem.Label]

They are the same label using:

Code:
<control type = "label">
                    <description>header label</description>
                    <posx>510</posx>
                    <posy>20</posy>
                    <width>700</width>
                    <height>30</height>
                    <font>Simplicity_40</font>
                    <label>$INFO[Skin.String(Delete_Show_Number_1)]</label>
                    <align>left</align>
                    <aligny>center</aligny>
                    <textcolor>white</textcolor>
                    <shadowcolor>black</shadowcolor>
                </control>
                <control type = "label">
                    <description>header label</description>
                    <posx>510</posx>
                    <posy>120</posy>
                    <width>700</width>
                    <height>30</height>
                    <font>Simplicity_40</font>
                    <label>$INFO[ListItem.TVShowTitle]</label>
                    <align>left</align>
                    <aligny>center</aligny>
                    <textcolor>white</textcolor>
                    <shadowcolor>black</shadowcolor>
                </control>

But when I compare them, I get nothing. I used:

Code:
<include condition="stringcompare(Skin.String(Delete_Show_Number_1),$INFO[Container().ListItem.TVShowTitle])">Delete_Eps</include>



- Hitcher - 2011-04-08

You need to put the actual number of the list control in the brackets.


- igotdvds - 2011-04-08

Hitcher Wrote:You need to put the actual number of the list control in the brackets.

Nope. This is driving me crazy!

Code:
<include condition="stringcompare(Skin.String(Delete_Show_Number_1),$INFO[Container(532).ListItem.TVShowTitle])">Delete_Eps</include>



- Hitcher - 2011-04-08

Stick both those labels outside of everything else and see what they return.

EDIT: Only just noticed you're using this as an include condition which could be the problem because include conditions are only checked once on loading the current window.


- igotdvds - 2011-04-08

Hitcher Wrote:Stick both those labels outside of everything else and see what they return.

EDIT: Only just noticed you're using this as an include condition which could be the problem because include conditions are only checked once on loading the current window.

I stuck them outside and they return the same values. You think its the include? Is there a workaround?


- Hitcher - 2011-04-08

Well it will only do the compare when you load MyVideoNav.xml so more than likely.


- igotdvds - 2011-04-08

Hitcher Wrote:Well it will only do the compare when you load MyVideoNav.xml so more than likely.

How could I get it to load more than once? Also, where would I have to put it, to make that stringcompare work?

Ok, this officially doesnt work! You cant copare two INFOs. I have displayed both of them on the screen and the compare always returns false?


- Hitcher - 2011-04-08

You can't get an include condition checked more than once when the window loads, instead you'll have to use a visible condition.


- igotdvds - 2011-04-08

Hitcher Wrote:You can't get an include condition checked more than once when the window loads, instead you'll have to use a visible condition.

Well on my way. Thanks Hitcher.


- igotdvds - 2011-04-08

Got it. Now users can pick the shows they want to enabled the prompt to delete for.

Image

--

Image

--

Image


RE: How do we use stringcompare for two labels? - Elsmoke - 2013-01-04

hi, im a complete noob in xbmc but i find this feature (auto delete) a must have, first thanks for all your work already done. I installed the skin and works very nice, the one thing i would love is the abillity to add ALL tv series (i have 66)i literally would pay for that!!! please take this into consideration, thanks again!