Kodi Community Forum

Full Version: Locale of MPAA ratings
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Mods, as this affects me as a skinner I thought this might be the best place to bring this up.  Please feel free to move it if you feel otherwise.

To show the MPAA ratings in the info screens and various views, I display a particular countries Ratings graphics instead of using the ratings text as a lot of skins do. It never occurred to me that I had an issue with this in my skin as I have hand edited all of my library MPAA ratings by hand to read in my case Australia:M (or whatever the rating may be).  I have recently changed the location setting for the movie database scrapper to Australia but still see ratings strings that show as Rated M as per the previous example instead of something like what I am expecting.

Is there a way to find the ratings location via the skin engine or do I need to make a feature request for either Kodi to return certification location via a skin string or is this something better handled by the scrapper itself?

Wyrm
I have done the same as you and hand edited my MPAA ratings for Australia to display. TheMovieDB scraper does not give the option to prefix the scraped rating.

The Universal Movie Scraper does. In the image, the last line can be changed from "Rated" to "Australia:" or whatever country is required. I now use UMS as my scraper (one less thing to adjust after a scrape)

Of course, this does not fix the problem for TV Shows.

Many, many moons ago I asked @olympia if that function could be added to the default scraper, but at the time it was not convenient to do so and to use UMS instead.

I have also noticed that most skins don't have the full compliment of country ratings, which probably explains why so many library view images on the forum always show "NR"


Image
Karellen,

Thanks for the info on Universal scrapper. Yep that has cut back my messing around for movies.

Would be really nice if all relavant scrappers did likewise. But also would be really useful to have the locale string so skin writers could do something to provide a sensible default location to use in something automagic for less sophisticated users.

I have included as many certification images as I could source, but again this is something that should be made a image resource for use by anyone that needs it.

I guess this is yet another area where it would be nice to handle in a standard way.

Wyrm
(2019-03-26, 14:10)wyrm Wrote: [ -> ]but again this is something that should be made a image resource for use by anyone that needs it.
Yes I agree. Since I first started playing around with ratings I wondered why this was not the case. Should be the same treatment that Studio logos, weather icons etc receives. I suppose it ia the same with all parts Kodi, waiting for someone to find the time to accomplish the task.

Also adding the required Australian xml entries into various skins to make them work was a bit of a pain also.
I haven't played with it in my skin mod, but the code in the original skin is pretty complex for figuring out the rating country.  It seems like users from country X submitted the scheme for their country so it was added with a bunch of VARs, but there is the problem that the order you list the conditions can result in country Y rating flag getting displayed when you wanted X's.

scott s.
.
On my skin almost all mpaa icons are working, except the Australian mpaa icons make problems.
Well, have been poking around my skin some more to see exactly what I have been doing.  I am currently out to over fifty conditional values in my skin VAR that I use to display the correct image file. This is just not going to float, especially if your country is at the bottom of that list.  So I will be re-writing the code regardless to keep the VAR to a sensible length.

Ideally, the skin writer having a country code or name of the country that the scrapper is using for the certification ratings would be great. But I can see a way to bring that code in with a certification icon pack. With that in mind @ronie , could we please have a new resource type.  I'm thinking maybe something like resource.images.certification.[country code].[wide|short] and a type of "certificationicons" .

Then if the user has not set a country code for the certification icons, the skin could prompt the user to select and load a icon pack. The skin writer could strip the country code from the resource name and use that to check a much smaller list of MPAA ratings in a skin VAR to display the correct image.

Not completely automagic, but better than the current way of displaying these images. Does anyone have a better alternative?

Wyrm

NB/ typical overthinking the problem. If we have a resource file, there is no need for a skin VAR at all. Just make sure the image files are named the same way as the MPAA info and it is just a simple INFO tag in the IMAGE control.
I agree that something like this could be very helpful.

scott s.
.
sure, adding a new image resource type is no problem at all.

we just need to thinks things through a bit..
- what file naming scheme to use
- do we need an addon for each country, or can they all be merged into one addon
- perhaps update our scrapers...

just thinking out loud, what if the scapers would automatically set the prefix based on the selected country?
perhaps that would allow us to create a single image addon, with filenames like:
  • Australia PG.png
  • Australia M.png
  • ...
  • Germany 0.png
  • Germany 16.png
  • ...
  • USA PG.png
  • USA NC-17.png

the benefit of a single addon would be you could have it automatically installed with the skin and things will work out of the box.
otherwise users would have to manually install one for their country to get things to work.. and they would have to know exactly what prefix to enter in the scraper settings


but perhaps i'm just rambling... i'm sure you thought this through more than i did :-)
one thing is that  12 and 16 show instead of TV-PG or TV-MA
(2019-03-27, 00:13)Karellen Wrote: [ -> ]
(2019-03-26, 14:10)wyrm Wrote: [ -> ]but again this is something that should be made a image resource for use by anyone that needs it.
Yes I agree. Since I first started playing around with ratings I wondered why this was not the case. Should be the same treatment that Studio logos, weather icons etc receives. I suppose it ia the same with all parts Kodi, waiting for someone to find the time to accomplish the task.

Also adding the required Australian xml entries into various skins to make them work was a bit of a pain also. 
just need a folder with the images
xml:
<control type="image">
      <left>176</left>
       <top>0</top>
       <width>50</width>
       <height>50</height>
       <texture>$INFO[ListItem.Mpaa,special://skin/extras/flags/Mpaa/,.png]</texture>
       <aspectratio aligny="center">scale</aspectratio>
     </control>
(2019-04-01, 01:47)ronie Wrote: [ -> ]sure, adding a new image resource type is no problem at all.

Thanks for getting on board, will ultimately make for the best solution

Quote:we just need to thinks things through a bit..
- what file naming scheme to use
- do we need an addon for each country, or can they all be merged into one addon
- perhaps update our scrapers...

File naming does not matter, whatever seems appropriate to you. Just remember that MPAA is US only, certification describes the process, not the organisation.

Would be much easier to keep up to date if one file only. Only issue is that there can be differing sizes of images. In Australia the wide forms is used on movies and a narrow forms tends to be used on TV. Some countries only seem to have the narrow forms. So possibly two files, a wide and a narrow.

To use a resource file as I am suggesting will require we have the video scrapper writers on board to agree to a naming scheme to what is written into the MPAA field. As far as the skin writer is concerned it's simple, just use the following in their image block.

<texture fallback="some-value">$INFO[Listitem.MPAA,resource.image.blah,.png]</texture>

So, no need for skin writer to know the country code or even to re-write their skin when a new group of certification images are added to the system. Just add images to resource file and update the scrappers to allow for the new codes. Downside is that the scrapper writers will have to update their scrappers for it to work properly. Upside is its automagic as far as the user is concerned and it should be much quicker to display. Will also reduce the size of skins ever so slightly and thus reduce to load on the Kodi servers just a tiny bit.

Quote:just thinking out loud, what if the scapers would automatically set the prefix based on the selected country?
perhaps that would allow us to create a single image addon, with filenames like:
  • Australia PG.png
  • Australia M.png
  • ...
  • Germany 0.png
  • Germany 16.png
  • ...
  • USA PG.png
  • USA NC-17.png

the benefit of a single addon would be you could have it automatically installed with the skin and things will work out of the box.
otherwise users would have to manually install one for their country to get things to work.. and they would have to know exactly what prefix to enter in the scraper settings


but perhaps i'm just rambling... i'm sure you thought this through more than i did :-)
Think away my friend. This thread is me thinking out load, first idea involves country code strings and large VAR's. Have come up with a much improved solution by using forum as a sounding board.

I like your suggestion for image naming as does not involve any dodgy characters in names and is human readable if skin writer decides to use the text instead of an image. Does depend on the scrapper writers, but maybe you can wiggle your eyebrow at them and convince them its a good idea. Will also mean the user will need to rescrape their videos to pick up the new naming convention. But will only be a once off event.

Wyrm
Well, I opened a can of worms there. Have been cleaning up my code and images so I had something to start on a resource file and boy what a mess.

Number of conclusions from the exercise:
  • Wide classification icons are unusual, most have a square aspect ratio.
  • There is NO standard way to write out MPAA listitem and as such no standard way to show classification icons. Thus the reason a lot of skin writers just don't bother and just display the MPAA listitem as a string.
  • May be completely wrong on this but there would appear to be a limited number of countries covered by scrappable websites that have the certification available to add to the video database.

So moving forward on this I have made a initial set of icons that are available in my skins source tree on github. They are 64x64 pixels and don't look too bad (Sam Fisher would probably roll his eyeballs at them, but it's a reasonable start). Feel free to steal anything you want.

I also have a series of skin VAR's in my skin that people are also welcome to use (try to keep the comments about my shit code reasonable civel as I am a delicate flower and offend easily). Failing that, offer up something better for everyone to share. As mentioned previously if we could get the scrapper writers on board we could reduce the mess of VAR'S down to one $INFO with a resultant major speed up of classification image handling. But that is something for when we can make a really good case for why they should bother.

I will make a list of what countries are currently handled by the scrappers so that we know which countries need to have images in the initial resource file.

And finally, maybe we need to look at asking a python jockey nicely if they could code a addon to allow the user to update the MPAA field of video database to reflect their counties classifications. So ask for users country and then present a list of valid ratings for that country that the user can select for each movie.

I will keep plugging away at this and report back here with any additional info.

Wyrm
Thanks @wyrm,

Looking at the Australian classification...
1. You have separated Movies and TV. Is there a reason for the distinction as they both use the same classification system
2. There are classifications I have not heard of, such as TV-AV, TV-C, E. What are these ones?

See here... http://www.classification.gov.au/Pages/Home.aspx
(2019-04-09, 06:43)Karellen Wrote: [ -> ]Thanks @wyrm,

Looking at the Australian classification...
1. You have separated Movies and TV. Is there a reason for the distinction as they both use the same classification system

@Karellen in actual fact there are two separate ratings systems in use in Australia. I don't watch too much live TV so only noticed it myself just recently. At the start of most programs you will see a ratings warning, this is were you see the TV images I have included. Me personally, I have been using the movie versions and hand editing the nfo file.

Quote:2. There are classifications I have not heard of, such as TV-AV, TV-C, E. What are these ones?

See here... http://www.classification.gov.au/Pages/Home.aspx

AV - Adult/Violence, C - Children, E - Exempt from classification (have seen that on one of my very early Mythbusters disks), basically the same as a G anyone can watch.

Just on my initial research, most countries have a dule ratings system. No idea why, but it would seem that TV stations either likes to or are required to break things down more as far as classifications are concerned.

Wyrm
Pages: 1 2