[HELP]MPAA Rating With Icon
#1
I know this has been discussed in a previous thread, but I thought I would bring it back to attention. I was wondering is anyone knows of a way to get a skin to show the mpaa rating with and icon of the rating.

I have all the rating icons and would like to have my skin project them. I have seen it in the AMT plugin, but could not find any where in the code of how it pulls the correct icon according to the rating.

Secondly, I have also seen where it seems to be possible according to the screenshost of the new AEON Stark screenshots with their movie information screen...seen here....http://forum.xbmc.org/showthread.php?tid=45038
The mpaa rating icon has to have some code for pulling it according to the movie info. (if these are not just mock images)

If anyone can give some insight I would think a lot of people would be interested. Thanks in advance.
Reply
#2
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
Reply
#3
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?
Reply
#4
Here's how I'm doing it....

Code:
    <control type="image">
<posx>900</posx>
<posy>40</posy>
<width>100</width>
<height>40</height>
<visible>System.IdleTime(3)</visible>
<texture>$INFO[ListItem.mpaa].png</texture>
</control>
Reply
#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.
Reply
#6
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?
Reply
#7
I extracted my xpr for pm3.hd and there are some good ones in the amt folder
Reply
#8
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?
Reply
#9
edit: the 3rd param is not length.

request a new parameter, length
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#10
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?
Reply
#11
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>
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#12
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?
Reply
#13
not
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply

Logout Mark Read Team Forum Stats Members Help
[HELP]MPAA Rating With Icon0