Kodi Community Forum

Full Version: How to Show MPAA/Certification?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
This seems like the most basic info out there but I can't figure out how to show this on this skin? It's on every other skin, but not the default one! As a parent, this is required so I know if it's safe to show my kid a movie or not.

I'm well aware about smart playlists, and this is not what I want.
@djvj 
By default, the Estuary skin does not show the MPAA rating on any of the skin views AFAIK. However, you can view the MPAA rating on the Video Info Dialog by pressing (i) on either your remote or keyboard as per below image on the left. Check the right hand side box, 2nd item from the bottom.
If you are looking to have the MPAA rating show on the actual skin view, probably the best place would be to include it as a media flag as per the below example on the right (media flag at the bottom of the screen). To achieve this, you will need to edit one of the Estuary skin xml files and also create a custom version of the Estuary skin, as users cannot edit the default Estuary skin files. If this is what you are looking for instead of using the video info screen and are happy to do a couple of very light skin edits, let me know and I can tell you what to do:-
ImageImage 
Ps....I'm using Windows btw.
(2021-09-13, 22:32)Dumyat Wrote: [ -> ]@djvj 
By default, the Estuary skin does not show the MPAA rating on any of the skin views AFAIK. However, you can view the MPAA rating on the Video Info Dialog by pressing (i) on either your remote or keyboard as per below image on the left. Check the right hand side box, 2nd item from the bottom.
If you are looking to have the MPAA rating show on the actual skin view, probably the best place would be to include it as a media flag as per the below example on the right (media flag at the bottom of the screen). To achieve this, you will need to edit one of the Estuary skin xml files and also create a custom version of the Estuary skin, as users cannot edit the default Estuary skin files. If this is what you are looking for instead of using the video info screen and are happy to do a couple of very light skin edits, let me know and I can tell you what to do:-
 
Ps....I'm using Windows btw.

Yes, that's exactly where I want it on the skin!

The other thing I don't like is lack of "Play Trailer" on the context menu. I have to go into the movie info to play a trailer and that extra step seems silly to me when other skins do it.

It sucks having to use other skins just for these 2 things because the default one doesn't have it. I don't mind making the edits if I know where to do them.
@djvj 
Okay, since we are going to be modifying the Estuary skin files, you first need to create a duplicate copy of the Estuary skin for your own needs and call it something else.
I'm going to assume you are on Windows, which is the same as me. You first need to go to the C: drive on your PC, then navigate to program files, then click on the Kodi folder, then the addons folder. Once you have clicked the addons folder, you find a folder called 'skin.estuary' (near the bottom). You need to copy, then paste this entire folder to following new location on your PC:-
C:\Users\Your PC Name\AppData\Roaming\Kodi\addons 

Once this has been done, you then need to rename the 'skin.estuary' folder you copied to 'skin.my.estuary'.
Once this has been done, you need to click on this folder and open the addon.xml file using a text editor (something like Notpad++)
You then need to change the 'id' right at the top of page to read 'id="skin.my.estuary"
You also need to change 'name' on the same line to 'name="MyEstuary"
Once done, click on file, then save at the top of the screen.

This has basically created a duplicate copy of the default Estuary skin, but called 'MyEstuary'
You can test it works by opening Kodi then navigating to:-
System>>>Add-Ons>>>My Add-ons>>>Look and Feel>>>Skin
You should see the MyEstuary skin listed, but with a little 'X' next to it. Click on the skin, then click 'enable'
This will make this skin your current skin.

Okay, now exit Kodi and navigate back to the new skin folder you created earlier and copied to  C:\Users\Your PC Name\AppData\Roaming\Kodi\addons
Click on the skin.my.estuary folder, then the xml folder.
Open the includes.xml file using your text editor.
Navigate down the file until you reach the line that says <include name="MediaFlags"> (On my copy of Estuary this is line 347)
You will then see this piece of code just underneath:-
xml:
<control type="group">
                    <top>10</top>
                    <width>200</width>
                    <visible>!String.IsEmpty($PARAM[infolabel_prefix]ListItem.Premiered)</visible>
                    <include content="InfoFlag">
                        <param name="icon" value="lists/year.png" />
                        <param name="label" value="$INFO[$PARAM[infolabel_prefix]ListItem.Premiered]" />
                    </include>
 </control>
Directly underneath the last line of this code (</control>) copy/paste this code:-
xml:
<control type="group">
                    <width>115</width>
                    <visible>!String.IsEmpty($PARAM[infolabel_prefix]ListItem.MPAA)</visible>
                    <control type="label">
                        <width>115</width>
                        <height>60</height>
                        <align>center</align>
                        <aligny>center</aligny>
                        <label>$INFO[$PARAM[infolabel_prefix]ListItem.MPAA]</label>
                        <font>font_flag</font>
                    </control>
                    <include content="MediaFlag">
                        <param name="texture" value="flags/flag.png" />
                    </include>
</control>
Then click file>>>>save at the top of the text edit page.
When you re-open Kodi, the MPAA ratings will now show as a new media flag on your own copy of the Estuary skin (MyEstuary).
I know it's a fair amount of effort to achieve this, which you may not feel completely comfortable doing.
Just to let you know, I'm also working on a skin mod of Estuary which I hope to release shortly that has 3 additional views, that all include the MPAA ratings on them. One of these new views also has button for 'Play Trailer' as well:-
Image

Hope the above is of some help.
Cheers
@Dumyat 

That works!!

Though some movies are pulling too much info from that tag it seems, so it looks like this:
Image
lol.....Was just about to message you back, cos everything looked good on your message.  
Oversight on my part for not mentioning that you also needed to enable, then select use.  Wink

Is everything working with the MPAA rating now? Depending on the Geo location and the format of your ratings, you may need to increase the width on the piece of code I posted previously to avoid any overlap outside of media flag border.
Yea trying to get it just right but the widths aren't playing nice and clearly some regex or something needs to be applied to these tags to only show the rating and not the full info.
I increased both widths to 200 and this is the look:

Image
Image
Okay, either increase the width on the code I posted previously, as described above or.......install the metadata editor. With this addon you can very easily edit your MPAA ratings, so it doesn't include any prefix, ie instead of 'Rated R for...' you can just edit to 'R'. This is probably tidier, as you don't have media flag that one media flag that is really long in length.

I use the metadata editor all the time to change my own MPAA ratings any genre info. Just one hint, turn all the option off on the metadata editor, as you only really need it to make manual edits as and when required.
(2021-09-23, 22:55)djvj Wrote: [ -> ]Yea trying to get it just right but the widths aren't playing nice and clearly some regex or something needs to be applied to these tags to only show the rating and not the full info.
I increased both widths to 200 and this is the look:

Image
Image
That's because currently, the alignment is set to center. If you set it to left, then the Rated R would move to left side of the box.
So looking at my nfo files, the mpaa field has the full reasons for the rating, but this field has just what I need:
<mpaa>Rated R for language and sex-related humor</mpaa>
<certification>US: R</certification>

I tried changing these to this but the field just doesn't show up now:
<visible>!String.IsEmpty($PARAM[infolabel_prefix]ListItem.certification)</visible>
<label>$INFO[$PARAM[infolabel_prefix]ListItem.certification]</label>
(2021-09-23, 23:18)djvj Wrote: [ -> ]So looking at my nfo files, the mpaa field has the full reasons for the rating, but this field has just what I need:
<mpaa>Rated R for language and sex-related humor</mpaa>
<certification>US: R</certification>
Ah right, gotcha. So your MPAA rating tag is for the MPAA rating description and the certification tag on your NFO is actual the rating.
How did you originally scrape your movies into Kodi, using one of Kodi scrapers or did you perhaps use a media manager to get the metadata?

Reason I ask is Kodi only has the MPAA tag available for movie and TV certification ratings, so that is why you are only seeing the description.
You can click here and see all the listitem labels available in Kodi, Don't think there is one for certification, unless I missed it when I just looked:-
InfoLabels (wiki)
 
There might be a way to create some kind of custom variable to fetch the certification rating from your NFO file and display that.
Let think on this a bit.
Will let you know either way.
First, I use Tiny Media Manager.

So I thought about what you said, and I'm wondering if  that tag is leftover from an old version or a bug. So I looked into the settings more and noticed one that looks like it will not retain old tags and create fresh nfo files. So I enabled it and rescanned one movie to test.

Image

It changed that certification tag to match the mpaa one exactly now:
  <mpaa>US: R</mpaa>
  <certification>US: R</certification>

I can quickly fix all the nfos, but having over 2k movies, not sure a quick way to update kodi's database and retain my watched status and my custom tags. Those are the only thing in the db that's important.

Here is the updated nfo:
https://paste.kodi.tv/wafezugisa
Hmmm, I'm not sure of the best approach. 
If it was me, I'd probably use the metadata editor to update the MPAA rating for each movie title, but you can only do this one at time.
I can update maybe 10-12 movie titles per minute which is fairly good, but doing this for over 2K movie is still going to be long and boring process.
The only positive is the DB field is updated immediately and will also show the updated MPAA rating in Kodi straight away.
When everything is done, it's just simple job of exporting library to write these updated MPAA ratings to your NFO files. 
I know the metadata editor also has options in the settings to update the MPAA ratings on your collection, but I've never used it. I wouldn't want it to disrupt any of your other metadata based on my suggestion. I'm the same about my metadata and artwork that I've spent years organising.
Maybe @Karellen might be able to offer some other good advise on how best to tackle this.
(2021-09-24, 01:17)Dumyat Wrote: [ -> ]Maybe @Karellen might be able to offer some other good advise on how best to tackle this.
Sure.
Personally, with such a big library I would direct edit the database. It is quite simple to edit ratings, just like editing an excel spreadsheet.

If you sort on that column, you can group same ratings. Then edit the first one and copy down.

Make sure you exit Kodi, and take a backup of the database. If things go wrong, you can delete the edited one, and move the backup back.

Image
Thanks you two. I don't mind editing the sql db directly. Just have to grab it off my server first as it's shared.

Wouldn't be so bad if I could export the watched status and tags to my nfo files. Artwork is already saved in each movie folder, so no issue there if I had to wipe it all at least.

Good news, the WatchedList addon backs up my watched state to its own db and can restore it as well. My Tags I can rebuild manually, a little tedious but not nearly as bad as editing 2k+ movies in sql.
Pages: 1 2