Posts: 459
Joined: Jan 2007
Reputation:
10
2009-01-05, 12:19
(This post was last modified: 2009-01-05, 12:28 by watzen.)
Make sure you don't have any trailing or leading spaces on the "bar":
Do not:
substring(foobar, bar,Right)
substring(foobar,bar ,Right)
substring(foobar, bar ,Right)
Do
substring(foobar,bar,Right)
(this had me puzzled a couple of minutes on stringcompare())
- Livingroom - C2D E8400, P5N7A-VM on a Samsung 46" LE46M86 FullHD via HDMI
- Kitchen - ASRock 330 HT Displayed on a Samsung Lapfit 22" dual touch screen LD220Z
- Bedroom - LG Laptop on a 32" tv
Posts: 12,706
Joined: Nov 2003
Reputation:
129
spiff
Team-Kodi Member
Posts: 12,706
watzen, your wiki entry does not mention the fact that you can do
substring(foobar,oo) and it will match. that is the possibility to not specify left or right (which means it will match anywhere in the string)
Posts: 459
Joined: Jan 2007
Reputation:
10
I'm 100% sure I added that last night.
edit: And I did...
(cur) (last) 00:07, 5 January 2009 Watzen (Talk | contribs) (14,483 bytes)
substring(info,string) Returns true if the string is found anywhere in the info
substring(info,string,[Left or Right]) Returns true if the string is found from the start or the end.
Example:
(foobars,foob,Left) -> true
(foobars,foob,Right) -> False
(foobars,bars,Right) -> true
- Livingroom - C2D E8400, P5N7A-VM on a Samsung 46" LE46M86 FullHD via HDMI
- Kitchen - ASRock 330 HT Displayed on a Samsung Lapfit 22" dual touch screen LD220Z
- Bedroom - LG Laptop on a 32" tv
Posts: 12,706
Joined: Nov 2003
Reputation:
129
spiff
Team-Kodi Member
Posts: 12,706
ah you put it as a separate entry. sorry bout that
Posts: 459
Joined: Jan 2007
Reputation:
10
hmm, with this you could do a pseudo hd-flagging on the selected item with
<visible>substring(listitem.filename,720p) | substring(listitem.filename,1080p) | substring(listitem.filename,1080i)</visible>
But I like CapnBry's way better, but if you want to have HD-flagging before it makes it to the main branch you could do it this way.
- Livingroom - C2D E8400, P5N7A-VM on a Samsung 46" LE46M86 FullHD via HDMI
- Kitchen - ASRock 330 HT Displayed on a Samsung Lapfit 22" dual touch screen LD220Z
- Bedroom - LG Laptop on a 32" tv
Posts: 1,747
Joined: Jun 2004
Reputation:
12
blittan
Retired Team-Kodi Member
Posts: 1,747
@watsen: good idea.. you could match filename for ex. offline (if you have an offline movie entry)
Posts: 2,087
Joined: Jun 2007
Reputation:
92
djh_
Aeon Project Founder
Posts: 2,087
I have a sneaking suspicion it can't handle capped letters. Hence the "Rated R" not working, as well as my recent attempt of "Bluray". "bluray", however, does work.
Posts: 26,215
Joined: Oct 2003
Reputation:
187
It should be matching case-insensitive, but perhaps it's not.
Posts: 1,747
Joined: Jun 2004
Reputation:
12
blittan
Retired Team-Kodi Member
Posts: 1,747
it's maybe the space in between thats causing problems..
Posts: 459
Joined: Jan 2007
Reputation:
10
2009-01-06, 02:29
(This post was last modified: 2009-01-06, 03:21 by watzen.)
I think I have fixed it(I lowercased both strings) and simplified the "else" with label and compare instead of GetLabel(info.GetData1()) and m_stringParameters[info.GetData2()].
I'll post a patch on the trac.
edit: fixed in svn r16901
- Livingroom - C2D E8400, P5N7A-VM on a Samsung 46" LE46M86 FullHD via HDMI
- Kitchen - ASRock 330 HT Displayed on a Samsung Lapfit 22" dual touch screen LD220Z
- Bedroom - LG Laptop on a 32" tv