Posts: 5,292
Joined: Jun 2006
Reputation:
62
Jezz_X
Team-XBMC Skinner
Posts: 5,292
It is possible to do it via the new string compare stuff (can't temember the actual code right now but there is a big thread about it) it basically checks for the text like PG-13 and displays an image if it exsists
Posts: 1,234
Joined: Nov 2008
Reputation:
5
After looking through some threads I found the following code that I thought would do what I am looking for.
<control type="image">
<posx>7</posx>
<posy>68</posy>
<width>166</width>
<height>38</height>
<texture>mpaa_restricted.png</texture>
<visible>substring(listitem.mpaa,Rated R)</visible>
</control>
I placed it within viewsvideolibrary.xml (pm3.hd) in the movie fanart extra section. Movie fanart view is the only view I use. I put it above the code for the movie name, since I want the rating image to project in the area with the the movie name, duration, ect. It shows the image that I want, but it does not change as I scroll through my movies. I have .nfo files in all my movie folders scraped with media companion.
Any suggestion as to what I might have to change in order to get this working properly?
Posts: 1,234
Joined: Nov 2008
Reputation:
5
My above code does in fact work. I was testing it on windows and did not have the latest svn. It worked on my xbox with the 1-25 t3ch release. Very nice feature to have.
Posts: 1,881
Joined: Aug 2007
Reputation:
1
Where is everyone getting the images for the MPAA ratings? Surely there must be somewhere to get decent versions or is everyone creating their own?
Posts: 1,234
Joined: Nov 2008
Reputation:
5
I extracted my xpr for pm3.hd and there are some good ones in the amt folder
Posts: 1,234
Joined: Nov 2008
Reputation:
5
I found a slight bug in mine, It was hard to notice because the images layed on top of each other and matched up almost perfectly. When a movie is rated PG-13 it will also put the PG rating icon in there as well.
Is there a way to have it match specifically rather than if it finds just part of the string?
Posts: 3,909
Joined: Dec 2004
Reputation:
20
Nuka1195
Skilled Python Coder
Posts: 3,909
2009-03-03, 04:29
(This post was last modified: 2009-03-03, 04:32 by Nuka1195.)
edit: the 3rd param is not length.
request a new parameter, length
Posts: 1,234
Joined: Nov 2008
Reputation:
5
Sorry, but I am confused by your response.
Are you saying that it is not currently possible and that a new param needs to be requested for it.
I was also wondering if a substring(foobar,foo,Left) would work?
I have tried substring(listitem.mpaa,Rated PG-13,Left) & substring(listitem.mpaa,Rated PG,Left), but they still stack on top of each other for PG-13 movies. I am a little unclear on these strings. If you select Left does it have to start with the first word on the left (ie. Rated) or if you select right and then use -13 will it go in until -13 is reached? Or does -13 have to be the end of the right string?
Posts: 3,909
Joined: Dec 2004
Reputation:
20
Nuka1195
Skilled Python Coder
Posts: 3,909
yes, a new param would help, but.
try using for pg-13
<visible>substring(listitem.mpaa,Rated PG-13)</visible>
then for PG
<visible>substring(listitem.mpaa,Rated PG) + !substring(listitem.mpaa,Rated PG-13)</visible>
Posts: 1,234
Joined: Nov 2008
Reputation:
5
That worked perfect. I appreciate you time on it.
One last quick question just for my own knowledge base. What exactly does the "!" do for the code?