Kodi Community Forum

Full Version: [HELP APPRECIATED] MPAA flags for multiple languages
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi guys,

my skin supports only the USA ratings at the moment and I'm willing to change that but I can't (and don't want to Tongue) do it all by myself. Currently the common technique for displaying the MPAA ratings is with (sub)string comparisons but I want to go another way which reduces code and helps you to create ratings for your language.

This is how the code looks like... it slightly increases the amount of images but I don't have to mess around with substrings.
PHP Code:
<texture>$INFO[ListItem.MPAA,flags/mpaa/movie/,.png]</texture

Main problem is that there is no exact naming convention for the ratings so I think we should stick to the ratings from the tmdb, imdb (universal scraper) and tvdb scraper (for tv shows) for now. For movies we should also require the default rating prefix which is "Rated ". I don't like this "hardcoded" prefix very much (you can use a custom one with the new universal scraper) but that's how it is. Therefore USA ratings are named "Rated PG.png", "Rated PG-13.png" etc. ... there are also some special cases like "Rated Approved" (= Rated PG) or different naming like "Rated Not Rated", "Rated Unrated" etc.

You can create the rating images with these templates, I've also updated the skin on github. The rating flags are located in media/flags/mpaa/.
Photoshop templates

You can also report missing images here. I've likely already forgotten some for the USA ratings.

All help is much appreciated, thanks. Smile
Thank you Black.
One question: so to have it working I need to have the "Rated " prefix in my library?
If I gust have the rating itself it won't work?

I can send you or post the italian MPAA icons (I already sent them to you with a PM some time ago).

Dakkar
The image has to named the same as the mpaa label. So theoretically it would work with any label if the image was there. But since we don't know all possible combinations, I would go with "Rated " because that's what TMBb and Universal Scraper use by default at the moment, so most users will have that.

I hope that we have just the rating itself in the future and unique labels, so it's just "PG-13" or "R" and nothing else.

You can post the link here but please use the template to create the icons. Smile
(2013-02-09, 14:02)`Black Wrote: [ -> ]I would go with "Rated " because that's what TMBb and Universal Scraper use by default at the moment, so most users will have that.
I think 'Rated' is used only for US ratings. This is the code I added to + mod based on Aeon Nox code and there is no 'Rated' prefix for UK ratings and there are multiple prefixes for DE so not sure what is actually used. Also I added IT ratings based on Dakkar findings in the library and also no 'Rated' prefix...
(Since no one complained I presume this ratings do work)

PHP Code:
<!-- IT ratings-->
            <
control type="image">
                <
description>IT-T Rating label</description>
                <include>
MPAADimensionsSmall</include>
                <
texture>flags/mpaa/IT/rating-t.png</texture>
                <
visible>StringCompare(ListItem.MPAA,T)</visible>
            </
control>  
            <
control type="image">
                <
description>IT-VM14 Rating label</description>
                <include>
MPAADimensionsSmall</include>
                <
texture>flags/mpaa/IT/rating-vm14.png</texture>
                <
visible>StringCompare(ListItem.MPAA,VM14)</visible>
            </
control>  
            <
control type="image">
                <
description>IT-VM18 Rating label</description>
                <include>
MPAADimensionsSmall</include>
                <
texture>flags/mpaa/IT/rating-vm18.png</texture>
                <
visible>StringCompare(ListItem.MPAA,VM18)</visible>
            </
control>  
            <!-- 
DE ratings-->
            <
control type="image">
                <
description>FSK-0 Rating label</description>
                <include>
MPAADimensionsSmall</include>
                <
texture>flags/mpaa/DE/rating-0.png</texture>
                <
visible>SubString(ListItem.MPAA,Germany:0) | SubString(ListItem.MPAA,o.A) | SubString(ListItem.MPAA,Rated 0)</visible>
            </
control>  
            <
control type="image">
                <
description>FSK-6 Rating label</description>
                <include>
MPAADimensionsSmall</include>
                <
texture>flags/mpaa/DE/rating-6.png</texture>
                <
visible>SubString(ListItem.MPAA,Germany:6)| SubString(ListItem.MPAA,ab 6) | StringCompare(ListItem.MPAA,6) | SubString(ListItem.MPAA,Rated 6)</visible>
            </
control>  
            <
control type="image">
                <
description>FSK-12 Rating label</description>
                <include>
MPAADimensionsSmall</include>
                <
texture>flags/mpaa/DE/rating-12.png</texture>
                <
visible>SubString(ListItem.MPAA,Germany:12) | SubString(ListItem.MPAA,ab 12) | StringCompare(ListItem.MPAA,12) | SubString(ListItem.MPAA,Rated 12)</visible>
            </
control>  
            <
control type="image">
                <
description>FSK-16 Rating label</description>
                <include>
MPAADimensionsSmall</include>
                <
texture>flags/mpaa/DE/rating-16.png</texture>
                <
visible>SubString(ListItem.MPAA,Germany:16) | SubString(ListItem.MPAA,ab 16) | StringCompare(ListItem.MPAA,16) | SubString(ListItem.MPAA,Rated 16)</visible>
            </
control>  
            <
control type="image">
                <
description>FSK-18 Rating label</description>
                <include>
MPAADimensionsSmall</include>
                <
texture>flags/mpaa/DE/rating-18.png</texture>
                <
visible>SubString(ListItem.MPAA,Germany:18) | SubString(ListItem.MPAA,ab 18) | StringCompare(ListItem.MPAA,18) | SubString(ListItem.MPAA,Rated 18)</visible>
            </
control>  
            <!-- 
UK ratings-->
            <
control type="image">
                <
description>UK:U Rating label</description>
                <include>
MPAADimensionsSmall</include>
                <
texture>flags/mpaa/UK/rating-u.png</texture>
                <
visible>SubString(ListItem.MPAA,UK:U) + !SubString(ListItem.MPAA,UK:UC)</visible>
            </
control>  
            <
control type="image">
                <
description>UK:UC Rating label</description>
                <include>
MPAADimensionsSmall</include>
                <
texture>flags/mpaa/UK/rating-uc.png</texture>
                <
visible>SubString(ListItem.MPAA,UK:UC)</visible>
            </
control>  
            <
control type="image">
                <
description>UK:PG Rating label</description>
                <include>
MPAADimensionsSmall</include>
                <
texture>flags/mpaa/UK/rating-pg.png</texture>
                <
visible>SubString(ListItem.MPAA,UK:PG)</visible>
            </
control>  
            <
control type="image">
                <
description>UK:12 Rating label</description>
                <include>
MPAADimensionsSmall</include>
                <
texture>flags/mpaa/UK/rating-12.png</texture>
                <
visible>SubString(ListItem.MPAA,UK:12) + !SubString(ListItem.mpaa,UK:12A)</visible>
            </
control>  
            <
control type="image">
                <
description>UK:12A Rating label</description>
                <include>
MPAADimensionsSmall</include>
                <
texture>flags/mpaa/UK/rating-12a.png</texture>
                <
visible>SubString(ListItem.MPAA,UK:12A)</visible>
            </
control>  
            <
control type="image">
                <
description>UK:15 Rating label</description>
                <include>
MPAADimensionsSmall</include>
                <
texture>flags/mpaa/UK/rating-15.png</texture>
                <
visible>SubString(ListItem.MPAA,UK:15)</visible>
            </
control>  
            <
control type="image">
                <
description>UK:18 Rating label</description>
                <include>
MPAADimensionsSmall</include>
                <
texture>flags/mpaa/UK/rating-18.png</texture>
                <
visible>SubString(ListItem.MPAA,UK:18) + !SubString(ListItem.MPAA,UK:R18)</visible>
            </
control>  
            <
control type="image">
                <
description>UK:r18 Rating label</description>
                <include>
MPAADimensionsSmall</include>
                <
texture>flags/mpaa/UK/rating-r18.png</texture>
                <
visible>SubString(ListItem.MPAA,UK:R18)</visible>
            </
control>  
        </
control
Nox uses substrings, obviously there are no prefixes (this is the proper way at the moment but you need so much more code). "Rated " is used for all ratings in all languages with the TMDb and Universal Scraper (I tested it). So you have e.g. "Rated T", "Rated VM14" for italian ratings.
Black, I created DE, IT and UK flags using template, available on github if you want to use them.
Thanks. The DE flags need some more images but I'll add them.
FSK (DE) Ratings attached

http://ul.to/hf02z1op
I think my method isn't working as expected... at least I would have to add a skin setting where you have to choose the rating language because I can't put them all in the same folder due to overlapping.
(2013-02-15, 01:10)`Black Wrote: [ -> ]I think my method isn't working as expected... at least I would have to add a skin setting where you have to choose the rating language because I can't put them all in the same folder due to overlapping.
yes, this could be avoided if scrapers would set country prefix automatically based on language set in scrapers instead of 'Rated'

e.g.
  • IT-VM14
    UK-PG
    US-R
    DE-18
    ...etc
Yes it would be best to have an extra info label, e.g. ListItem.MPAAIcon
Using subfolders depending on language / region is not an option?

Does it work in Xperience1080plus?
It is an option but it would only work with an extra option. You would have to choose your language in the skin settings, otherwise it wouldn't work.

Maybe I'll use substrings after all which would mean the skin won't support every language... it's not gonna work properly with this method (yet).
Hey guys,
is there any common naming scheme, what to write into NFO to "fit them all"?
Could we (the skin designers) commit to a naming convention? Or should we parse all the different variants?

I would prefer a string containing multiple certs (as we get from the scrapers), all prefixed with iso2 country.
(to let the client decide, what to show; based on user country)
Like "USA:R / UK:15 / DE:FSK16" (whitespace removed)
Or is only a single country/cert/string in MPAA allowed?!
The <certification> tag in XML seems to be removed from XBMC12 spec, so only MPAA left...?


(eg: http://www.imdb.com/title/tt0468569/pare...tification )
I added flags for germany, italy and united kingdom. You have to choose the language in the skin settings if you want to use anything else than us ratings.
Pages: 1 2