SubString.Path.movies not working
#1
I am trying to make a skin show a dvd logo icon whenever the word "movies" appears in the path of the video file and I can't get it to work for the life of me. I have a variable named SourceFlagVar that contains:

Code:
<value condition="SubString(ListItem.Filename,dvd) | SubString(ListItem.Path,movies) | StringCompare(ListItem.FileExtension,iso) | StringCompare(ListItem.FileExtension,ifo)">dvd</value>

The variable is used in:

Code:
<include name="SourceFlag">
        <control type="image" id="4023">
            <!--Source logo-->
            <width>70</width>
            <height>50</height>
            <aspectratio>keep</aspectratio>
            <texture>$VAR[SourceFlagVar,flags/source/,.png]</texture>
            <colordiffuse>black</colordiffuse>
            <visible>!IsEmpty(Control.GetLabel(4023))</visible>
        </control>
    </include>

The other conditions in the variable all work which tells me the path to the image file is being found, but the SubString(ListItem.Path.movies) just will not work. The movies that I want flagged with the icon are all in the path: E:\Server\Movies\Movie Ttitle. I have another condition in the same variable that looks for:

Code:
SubString(ListItem.Path,blu-ray)

And it works just fine. Am I doing something wrong?
Reply
#2
Remove [b] around the substring? I don't think the label parser cares if it's in uppercase or not. Besides, those are in the wrong place, shouldn't those be around the "movies" if it did work that way?
Reply
#3
That is not in the actual code. I was trying to bold that section in my post so it would stand out, but forgot that it doesn't work in the CODE tag.

I'll remove that from my OP.
Reply
#4
Can you post the full variable? Are you using SubString(ListItem.Path,movies) above the example value condition? If you are, maybe the variable processing stops before the dvd value because one of the conditions have already matched?
Reply
#5
Here is the full variable:

Code:
<variable name="SourceFlagVar">
        <value condition="[SubString(ListItem.filename,PDTV) | SubString(ListItem.filename,sdtv) | SubString(ListItem.filename,sd tv)]">sdtv</value>
        <value condition="[SubString(ListItem.Filename,hdtv) | SubString(ListItem.Filename,hd tv)]">hdtv</value>
        <value condition="[SubString(ListItem.Filename,hddvd) | SubString(ListItem.Filename,hd-dvd)]">hddvd</value>
        <value condition="[SubString(ListItem.Filename,bluray) | SubString(ListItem.Filename,blu-ray) | SubString(ListItem.Filename,bdrip) | SubString(ListItem.Filename,brrip)] + [SubString(ListItem.Filename,.3D.) | SubString(ListItem.Filename,3DBD)]">bluray3d</value>
        <value condition="[SubString(ListItem.Filename,bluray) | SubString(ListItem.Filename,blu-ray) | SubString(ListItem.Filename,bdrip) | SubString(ListItem.Filename,brrip) | SubString(ListItem.Path,blu-ray)]">bluray</value>
        <value condition="SubString(ListItem.Filename,dvb)">dvb</value>
        <value condition="SubString(ListItem.Filename,web-dl)">web-dl</value>
        <value condition="SubString(ListItem.Filename,dvd) | SubString(ListItem.Path,movies) | StringCompare(ListItem.FileExtension,iso) | StringCompare(ListItem.FileExtension,ifo)">dvd</value>
    </variable>

None of the prior variables should be matched before it and no other flag icon is being displayed.
Reply
#6
It works in Confluence, just tested. But it seems the variable is always empty if you check it's visibility from another control, even though the flag shows.

So in short, does it work if you remove the visibility condition !IsEmpty(Control.GetLabel(4023))?

If that does not help i'll stop guessing Big Grin
Reply
#7
This is really strange. I copied the skin to my desktop computer without making any changes and the DVD flag appears fine for movies, but it still doesn't show on my laptop. Ironically, on my desktop the flag does not work in TV episodes. Both computers are Windows and I can't imagine why it would act different on different computers.

I tried making the change you suggested and it seems to work fine on all views on both computers. The problem is that without that visibility control I get gaps between my flags when one or more is missing from a given file. How do I combat that?
Reply
#8
Change the flag ordering so that this is the last flag so it cannot leave gaps, that's all i can think of.
Reply
#9
This still doesn't work with any consistency. Sometimes the DVD flag displays, but more often it doesn't. Oddly, my TV episodes have "DVD Rip" in their file names and

SubString(ListItem.Filename,dvd)

seems to work every time using the very same variable. This is so frustrating.
Reply
#10
I think I solved this. Although the path includes the plural word "movies", when I changed it to look for the substring "movie" (singular) it works every time I try it. I'll report back after more testing, but so far so good.
Reply

Logout Mark Read Team Forum Stats Members Help
SubString.Path.movies not working0