Why does this not work?
#1
If I make a label using $INFO[Window(Home).Property(ArtistEvents.1.Artists)] It shows the name of the artist in the label.

Anyone know why this does not return as true using StringCompare if they are both the same?

<visible>StringCompare($INFO[Window(Home).Property(ArtistEvents.1.Artists)],$INFO[Window(Home).Property(ArtistEvents.1.Artists)])</visible>

This is driving me nuts. Thanks for any responces.
Reply
#2
I'm in the process of tracking down a possibly-related bug - Are you running Windows and does the the artist contain a unicode character? Even if your answers are no, it's probably still a good idea to post what the artist name is that isn't matching, and the complete code for the control you're using whose visibility condition isn't working.

(And, if its not related, I'll post about my issue separately when I've diagnosed it more)
Reply
#3
should be:
Code:
StringCompare(Window(Home).Property(ArtistEvents.1.Artists),$INFO[Window(Home).Property(ArtistEvents.1.Artists)])
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#4
(2014-05-11, 00:43)Unfledged Wrote: I'm in the process of tracking down a possibly-related bug - Are you running Windows and does the the artist contain a unicode character? Even if your answers are no, it's probably still a good idea to post what the artist name is that isn't matching, and the complete code for the control you're using whose visibility condition isn't working.

(And, if its not related, I'll post about my issue separately when I've diagnosed it more)

(2014-05-11, 01:21)ronie Wrote: should be:
Code:
StringCompare(Window(Home).Property(ArtistEvents.1.Artists),$INFO[Window(Home).Property(ArtistEvents.1.Artists)])

Here is what I got going. I want to be able to StringCompare an artist that is playing in media player with a list of upcoming venues generated by running phil65's extendedinfo script and show the label "Upcoming Venues" if the artist has upcoming concert dates.
I have tried just about every combination of StringCompare and SubString that I can think of and nothing seems to work with StringCompare no matter how I try it. oh, yes i'm using windows and it doesn't matter what artist it is none of them work I have tried several, a couple in particular "Alice in Chains" "Blues Traveler" none work.Thanks

Code:
<control type="label">
  <Description>Ronie this one is your suggestion it is a no go</Description>
  <left>965</left>
  <top>800</top>
  <width>300</width>
  <height>48</height>
  <align>right</align>
  <label>Upcoming Venues</label>
  <font>Font_Reg26</font>
  <textcolor>$VAR[TitleColorVar]</textcolor>
  <visible>StringCompare(Window(Home).Property(ArtistEvents.1.Artists),$INFO[Window(Home).Property(ArtistEvents.1.Artists)])</visible>
</control>

<control type="label">
  <Description>This dont work even though they are the same</Description>
  <left>965</left>
  <top>800</top>
  <width>300</width>
  <height>48</height>
  <align>right</align>
  <label>Upcoming Venues</label>
  <font>Font_Reg26</font>
  <textcolor>$VAR[TitleColorVar]</textcolor>
  <visible>StringCompare($INFO[Window(Home).Property(ArtistEvents.1.Artists)],$INFO[Window(Home).Property(ArtistEvents.1.Artists)]</visible>
</control>

<control type="label">
  <Description>This is what I actually want to StringCompare but it also doesnt work</Description>
  <left>565</left>
  <top>820</top>
  <width>300</width>
  <height>48</height>
  <align>right</align>
  <label>Upcoming Venues</label>
  <font>Font_Reg26</font>
  <textcolor>$VAR[TitleColorVar]</textcolor>
  <visible>StringCompare(Window(Home).Property(ArtistEvents.1.Artists),$INFO[MusicPlayer.Artist])</visible>
</control>

<control type="label">
  <Description>Neither does this</Description>
  <left>565</left>
  <top>820</top>
  <width>300</width>
  <height>48</height>
  <align>right</align>
  <label>Upcoming Venues</label>
  <font>Font_Reg26</font>
  <textcolor>$VAR[TitleColorVar]</textcolor>
  <visible>StringCompare($INFO[Window(Home).Property(ArtistEvents.1.Artists)],$INFO[MusicPlayer.Artist])</visible>
</control>

<control type="label">
  <Description>This label shows</Description>
  <left>965</left>
  <top>850</top>
  <width>600</width>
  <height>48</height>
  <align>right</align>
  <label>$INFO[Window(Home).Property(ArtistEvents.1.Artists)]</label>
  <font>Font_Reg26</font>
  <textcolor>$VAR[TitleColorVar]</textcolor>
  <visible>true</visible>
</control>

<control type="label">
  <Description>This label shows</Description>
  <left>965</left>
  <top>880</top>
  <width>600</width>
  <height>48</height>
  <align>right</align>
  <label>$INFO[MusicPlayer.Artist]</label>
  <font>Font_Reg26</font>
  <textcolor>$VAR[TitleColorVar]</textcolor>
  <visible>true</visible>
</control>
Reply
#5
Afaik you cant use $INFO with stringcompare. So it would need to be
Code:
StringCompare(Window(Home).Property(ArtistEvents.1.Artists),Window(Home).Property(ArtistEvents.1.Artists))
Reply
#6
(2014-05-11, 18:56)BigNoid Wrote: Afaik you cant use $INFO with stringcompare. So it would need to be
Code:
StringCompare(Window(Home).Property(ArtistEvents.1.Artists),Window(Home).Property(ArtistEvents.1.Artists))

Hmmm... this does not work what you posted... weird.Huh?
Code:
<visible>StringCompare(Window(Home).Property(ArtistEvents.1.Artists),Window(Home).Propert​y(ArtistEvents.1.Artists))</visible>
It seems it should work if they are the same but it don't..

However this code below does work...
Code:
<visible>StringCompare(Window(Home).Property(ArtistEvents.1.Artists),MusicPlayer.Artist)</visible>

Also shouldn't SubString work, as in this? It doesn't return anything at all.
Code:
<visible>SubString(Window(Home).Property(ArtistEvents.1.Artists),MusicPlayer.Artist)</visible>

The reason I ask is because sometimes there are more than one artist, I suppose they call that a "Festival"
So I thought SubString would work as per the skinning manual info for SubString states "Returns true if the string is found anywhere in the info"
The code just above this works using StringCompare but the same code using SubString doesn't work. It's all just too weird to me.
Reply
#7
comparing the same infolabels would return true always, so there's really no point in that.
The substring should work too, but I've seen it behave weird at times where a stringcompare returns true as I would expect and a substring on the same info returns false. If you can effectively reproduce this behavior I suggest making a trac ticket for that.
Reply
#8
(2014-05-11, 20:18)BigNoid Wrote: comparing the same infolabels would return true always, so there's really no point in that.
The substring should work too, but I've seen it behave weird at times where a stringcompare returns true as I would expect and a substring on the same info returns false. If you can effectively reproduce this behavior I suggest making a trac ticket for that.

Yeah I was just using the same info labels to compare to test if anything would work if I knew it was exactly the same
It's strange because this works
Code:
<visible>StringCompare(MusicPlayer.Artist,MusicPlayer.Artist)</visible>

But this doesn't.
Code:
<visible>SubString(MusicPlayer.Artist,MusicPlayer.Artist)</visible>
Can anyone verify this doesn't work?
Reply
#9
With substring, the first parameter is considered fixed. i.e. it's evaluated at time of parsing (XML load) not on the fly. Obviously MusicPlayer.Artist will be something different at load time than at runtime.

StringCompare has both arguments evaluated on the fly.
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
#10
Wiki updated Smile
Image [RELEASE] Metroid
Image [RELEASE] IrcChat
Reply
#11
(2014-05-12, 04:58)jmarshall Wrote: With substring, the first parameter is considered fixed. i.e. it's evaluated at time of parsing (XML load) not on the fly. Obviously MusicPlayer.Artist will be something different at load time than at runtime.

StringCompare has both arguments evaluated on the fly.

With my bad english, i think I have the same problem?
I would a content based similar genre movie and tvshow list to open it with the contextmenue.
I write all GenreDBID and Labels from a hidden container in the startup.xml in Strings.

Code:
<value condition="Stringcompare(ListItem.Genre,Skin.String(SimilarGenre0Label))">videodb://tvshows/genres/$INFO[Skin.String(SimilarGenre0DBID)]/</value>
With multiple genres Stringcompare doesn't work of course.

Code:
<value condition="Substring(ListItem.Genre,Skin.String(SimilarGenre0Label))">videodb://tvshows/genres/$INFO[Skin.String(SimilarGenre0DBID)]/</value>
With Substring, Control.GetLabel or Propertys as first or second argument (with or without $INFO), the variable is Empty on singel and multiple genres.

As I understand you correctly should it be work with the second argument?

Code:
<value condition="Substring(ListItem.Genre,Comedy">special://skin/playlists/genres/tv/Comedy.xsp</value>
work also with multiple genres like Comedy / Sitcom but not with Strings?

Any chance for a solution or is this impossible?

Thanks for any responces.
Reply

Logout Mark Read Team Forum Stats Members Help
Why does this not work?0