How do we use stringcompare for two labels?

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
igotdvds Offline
Skilled Skinner
Posts: 1,616
Joined: Jul 2009
Reputation: 11
Post: #1
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?
find quote
Hitcher Online
Skilled Skinner
Posts: 10,626
Joined: Aug 2007
Reputation: 91
Location: Eastleigh, UK
Post: #2
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]) 
find quote
igotdvds Offline
Skilled Skinner
Posts: 1,616
Joined: Jul 2009
Reputation: 11
Post: #3
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.
find quote
Hitcher Online
Skilled Skinner
Posts: 10,626
Joined: Aug 2007
Reputation: 91
Location: Eastleigh, UK
Post: #4
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]
find quote
igotdvds Offline
Skilled Skinner
Posts: 1,616
Joined: Jul 2009
Reputation: 11
Post: #5
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>
find quote
Hitcher Online
Skilled Skinner
Posts: 10,626
Joined: Aug 2007
Reputation: 91
Location: Eastleigh, UK
Post: #6
You need to put the actual number of the list control in the brackets.
find quote
igotdvds Offline
Skilled Skinner
Posts: 1,616
Joined: Jul 2009
Reputation: 11
Post: #7
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>
find quote
Hitcher Online
Skilled Skinner
Posts: 10,626
Joined: Aug 2007
Reputation: 91
Location: Eastleigh, UK
Post: #8
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.
find quote
igotdvds Offline
Skilled Skinner
Posts: 1,616
Joined: Jul 2009
Reputation: 11
Post: #9
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?
find quote
Hitcher Online
Skilled Skinner
Posts: 10,626
Joined: Aug 2007
Reputation: 91
Location: Eastleigh, UK
Post: #10
Well it will only do the compare when you load MyVideoNav.xml so more than likely.
find quote
igotdvds Offline
Skilled Skinner
Posts: 1,616
Joined: Jul 2009
Reputation: 11
Post: #11
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?
(This post was last modified: 2011-04-08 19:19 by igotdvds.)
find quote
Hitcher Online
Skilled Skinner
Posts: 10,626
Joined: Aug 2007
Reputation: 91
Location: Eastleigh, UK
Post: #12
You can't get an include condition checked more than once when the window loads, instead you'll have to use a visible condition.
find quote
igotdvds Offline
Skilled Skinner
Posts: 1,616
Joined: Jul 2009
Reputation: 11
Post: #13
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.
find quote
igotdvds Offline
Skilled Skinner
Posts: 1,616
Joined: Jul 2009
Reputation: 11
Post: #14
Got it. Now users can pick the shows they want to enabled the prompt to delete for.

[Image: screenshot111a.png]

--

[Image: screenshot112b.png]

--

[Image: screenshot113c.png]
find quote
Elsmoke Offline
Junior Member
Posts: 1
Joined: Dec 2012
Reputation: 0
Post: #15
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!
find quote