Search the Community
Showing results for tags 'rating'.
Found 4 results
-
As someone who's gone through and changed just about everything in their Kodi library to support the Australian Classification System, it's pretty upsetting to find out that CinemaVision only supports a handful of rating systems. I'm sure i'm not the only one who'd like support for the Australian Rating system, to make their experience much better if they live in Australia like I do. For those who don't know, the Australian Rating system is as follows: AU:G AU:PG AU:M AU:MA15 AU:R18 AU:X18 I've gone through skins I have downloaded and managed to modify the Variables.xml to allow for the AU system, and this is typically as simple as changing Australia to AU, and changing the 'IsEqual' to 'Contains' for R18 and MA15, as they both have a + symbol that Kodi doesn't seem to like. I'm more than a little confused as to how I'd even go about editing CinemaVision to have this support though. With the support, we'd be able to have our own custom bumpers that match our Classification System. Not to mention, I feel like this is also why whenever I set the Trailers to match the feature, the trailers are suddenly skipped, because my movies aren't matching the 'MPAA:' rating that CinemaVision is expecting. Some movies are rated one thing here and another thing in the US, so a film that's been rated PG-13 in the US (to which our equivalent is M) might just be rated PG here. So it's not as simple as changing the images to look like Australia ratings when in reality CV is reading it as the MPAA rating. Thanks for taking the time read, and hopefully we can get some traction going on this!
-
Adding Custom Ratings to CinemaVision CinemaVision Version: 1.1.0 For the past year or two, I've been enjoying CInemavision but have always been very disappointed that the rating systems included are only for those in the US and a few countries in Europe. I've asked multiple times for the Australian rating system to be included and I've been told it's pretty easy but it hasn't really gone anywhere, which is fair enough considering I don't think it's fair for the devs to be focused on every country but instead, it should be a community effort. Upon digging through the add-on files and figuring out (to the best of my ability) how CInemavision includes a countries rating system, I've managed to add the OFLC to my copy of Cinemavision and I thought I'd document how I went about it in the hopes others who might be hoping to introduce their own rating system into Cinemavision can do so. Or, you know, improve on whatever I've managed to do. In any case, here's what I did to introduce the OFLC (Australia's rating system) into CInemavision. Requirements: Text Editor (Notepad++ Recommended) Custom Bumpers for your rating system (Either from the 'files' section or by creating your own) Movie Scraper Settings properly set to scan for your rating system (eg. TMDB classification set to your country code) Resources: Country Code Lookup: https://laendercode.net/en/2-letter-list.html Australian Classification Youtube Playlist (Try to find something similar for your country!): Kodi Addons Directory: Windows: %APPDATA%\kodi\addons\ MacOS: /Users/<your_user_name>/Library/Application Support/Kodi/addons/ Linux: ~/.kodi/addons/ Other: https://kodi.wiki/view/Userdata#Location_of_the_userdata_folder (replace 'userdata' with addons) CinemaVision Location: addons/script.cinemavision/ NOTE: MAKE A BACKUP BEFORE PROCEEDING. I AM NOT RESPONSIBLE FOR ANY DAMAGE OR ERRORS INCURRED Step 1: Creating the XML Reference Sheet Inside "lib/cinemavision/rating_systems/" we can see a list of .xml files that act as reference sheets. The is the BBFC as an example: <system name="BBFC"> <region>GB</region> <rating value="185">R18</rating> <rating value="180">18</rating> <rating value="150">15</rating> <rating value="125">12</rating> <rating value="120">12A</rating> <rating value="80">PG</rating> <rating value="0">U</rating> <rating value="0">Uc</rating> </system> The name parameter holds the classification name, with the region holding the countries region. After that, within the <system> tags, we create a new <rating> tag for every classification within our system. You'll also notice the value parameter within every <rating> tag. This is (to the best of my knowledge) what CinemaVision uses to determine the severity of the rating because it differs from country to country. For example, both 'U' and 'Uc' are 0 because they are different classifications but are both 'Universal' with the latter being specifically for children. In creating your own, you can adjust these values however you want, but I found it helpful to compare the values against the MPAA's values. In fact, it looks like the values represent the "minimum age" with a 0 at the end. The MPAA doesn't have a .xml file because it's hardcoded within 'ratings.py' but we can see there that the values are as follows: MPAA Values Rating Value G 0 PG 120 PG_13 130 R 160 NC-17 170 NC 1000 Note how PG-13 is '130' and NC-17 is '170', they represent what the rating states the minimum (or suggested minimum age) is. It doesn't really matter how closely they match the MPAA system but it can be a good point of reference when incorporating your own rating system into CInemaVision. For the most part, Australia's rating system is pretty similar to the MPAA, and this is what I came up with the OFLC: <system name="OFLC"> <region>AU</region> <rating value="180">R18</rating> <rating value="150">MA15</rating> <rating value="120">M</rating> <rating value="80">PG</rating> <rating value="0">G</rating> <rating value="0">E</rating> </system> E and G are both 0 because E films are 'Exempt' and G are 'General' so they both have no 'minimum' age. Using this as a template, you should have a pretty good idea of how to go about creating one of your own. When you're done, save the .xml as the classification name within the 'rating_systems' folder (in my case, OFLC.xml). Step 2: Adding references within the Python Code Wait, don't leave! I promise this isn't as scary as it sounds! Hear me out. What we need to do is go into 3 python files and add references to whatever classification we are adding. The first of which is located within the 'lib/cinemavision' directory, wherein we found 'rating_systems'. You'll notice a file called 'ratings.py' and that's what we need to edit, so open it in Notepad++ or your code editor of choice. All that we need to worry about is this little dictionary at the top: COUNTRY_SYSTEMS = { 'DE': 'FSK', 'GB': 'BFS', 'BR': 'DEJUS', 'ES': 'ICAA', 'US': 'MPAA' } It should be pretty self-explanatory - there's a country code and the corresponding classification system. Kodi actually uses these country codes internally instead of the system name, and it's here where CinemaVision links them up. Kodi uses the 'ISO 3166-1 alpha-2' convention (bit of a mouthful) but if you aren't sure, head up to the resources tab at the top of this post to find a lookup table for your country. As you might have guessed, it's pretty simple to add a new entry to the list. Make sure you add a comma to what came before and match this template: "country_code" : "classification_name" And that's it! Save ratings.py and we can move on. So my current COUNTRY_SYSTEMS dictionary looks like this: COUNTRY_SYSTEMS = { 'DE': 'FSK', 'GB': 'BFS', 'BR': 'DEJUS', 'ES': 'ICAA', 'US': 'MPAA', 'AU': 'OFLC' } The second file is just as harmless. In the same 'lib/cinemavision' directory, open 'content.py' and in the UserContent class you should see the 'Ratings Bumper' section: ('Ratings Bumpers', ( 'MPAA', 'BBFC', 'DEJUS', 'FSK', 'OFLC' )) Same as before, simply add a comma to the last entry and in single quotes add the classification name. Save, and we can move on the slightly harder part, but also the last of coding! Go back a directory so we're just in the "lib" folder, and you'll see 'cvutil.py'. Open that up, and do a search for the "RatingParser" class. It should be on line 393, but this is what we're looking for: class RatingParser: SYSTEM_RATING_REs = { # 'MPAA': r'(?i)^Rated\s(?P<rating>Unrated|NR|PG-13|PG|G|R|NC-17)', 'BBFC': r'(?i)^UK(?:\s+|:)(?P<rating>Uc|U|12A|12|PG|15|R18|18)', 'FSK': r'(?i)^(?:FSK|Germany)(?:\s+|:)(?P<rating>0|6|12|16|18|Unrated)', 'DEJUS': r'(?i)(?P<rating>Livre|10 Anos|12 Anos|14 Anos|16 Anos|18 Anos)' } RATING_REs = { 'MPAA': r'(?i)(?P<rating>Unrated|NR|PG-13|PG|G|R|NC-17)', 'BBFC': r'(?i)(?P<rating>Uc|U|12A|12|PG|15|R18|18)', 'FSK': r'(?i)(?P<rating>0|6|12|16|18|Unrated)', 'DEJUS': r'(?i)(?P<rating>Livre|10 Anos|12 Anos|14 Anos|16 Anos|18 Anos)' } It's...a little intimidating, but it's really not that bad. Basically, this is a 'regex' command that is designed to sort data and in this case, it's parsing ratings for every country. It follows the same structure that we've seen thus far with the classification name on the left, and the 'data' or 'result' on the right of a colon. All we really need to worry about is the result side of the dictionary, so I'll show you what I came up with for the OFLC and how I got there: SYSTEM_RATING_REs: 'OFLC': r'(?i)^(?:AU)(?:\s+|:)(?P<rating>E|G|PG|MA15|R18)' RATING_REs: 'OFLC': r'(?i)(?P<rating>E|G|PG|MA15|R18)' They're the same except 'SYSTEM_RATING_REs' looks for the country code whilst 'RATING_REs' doesn't. For your country, all you need to do for SYSTEM_RATING_REs is fill in your classification system, change the country code and add all of your ratings after the <rating> tag, with every rating having a | in between. and in RATING_REs, do the same except without the country. My recommendation here is to duplicate one of the lines that are already there, add an extra comma and replace the relevant information. I copied the BBFC and used that as a reference but it really doesn't matter, they all follow the same format so long as your country code and classifications are in there, next to your classification system. So this is how it should look, with the relevant information filled in of course: SYSTEM_RATING_REs = { # 'MPAA': r'(?i)^Rated\s(?P<rating>Unrated|NR|PG-13|PG|G|R|NC-17)', 'BBFC': r'(?i)^UK(?:\s+|:)(?P<rating>Uc|U|12A|12|PG|15|R18|18)', 'FSK': r'(?i)^(?:FSK|Germany)(?:\s+|:)(?P<rating>0|6|12|16|18|Unrated)', 'DEJUS': r'(?i)(?P<rating>Livre|10 Anos|12 Anos|14 Anos|16 Anos|18 Anos)', 'CLASSIFICATION_SYSTEM': r'(?i)^(?:COUNTRY_CODE)(?:\s+|:)(?P<rating>EACH|SEPERATE|RATING)' } RATING_REs = { 'MPAA': r'(?i)(?P<rating>Unrated|NR|PG-13|PG|G|R|NC-17)', 'BBFC': r'(?i)(?P<rating>Uc|U|12A|12|PG|15|R18|18)', 'OFLC': r'(?i)(?P<rating>E|G|PG|MA15|R18)', 'FSK': r'(?i)(?P<rating>0|6|12|16|18|Unrated)', 'DEJUS': r'(?i)(?P<rating>Livre|10 Anos|12 Anos|14 Anos|16 Anos|18 Anos)', 'CLASSIFICATION_SYSTEM': r'(?i)(?P<rating>EACH|SEPERATE|RATING)' } Save that and, phew, done! That's all of the coding out of the way, and we're almost done too! Just one more thing... Step 3: Adding Classification into UserData After all of this, you'd think we'd be done. And I did too, but for the longest time I couldn't figure out why when I went to select OFLC in the CinemaVision settings it wasn't there. That's because the options are actually generated in a completely different directory. Go right out, back into the Kodi base directory, so out of addons and go to the following directory: kodi_base/userdata/addon_data/script.cinemavision/settings/ratings Here, you'll see a folder of every classification. And inside every folder is null files with a name following this format: CLASSIFICATION_SYSTEM.RATING So we need to create a new folder with the system name and fill it with void files that have the same naming structure. I simply copied the MPAA files and renamed the ones I needed to and copied and pasted an additional one for 'E'. You're going to need to be able to alter file extensions so make sure you can see file extensions and alter them before going forward - Google is your friend! Step 4: Profit! ... for now And that's it! Now if you go into the CinemaVision settings and go to change settings, you'll be able to select your new system! So, what now? Well, assuming your movie scraper settings are set to support your country, the next time you try to run CinemaVision with your new system you should see it in the menu but you won't get any rating bumpers because we don't have any! This part should be pretty easy for those who have bothered to read this far as you should be familiar with adding custom content. Basically just set a content folder, go into Ratings Bumpers, create a folder for the new system and fill it with videos/images with the rating for the name (MA15.png/MA15.mp4), then update the content in the settings every time you add something new. I managed to find a collection of videos on youtube someone had made for their own personal collection which I am planning on reuploading for Australians who stumble here wanting to find OFLC content. That playlist can be found in the resources up the top, but google your classification with "bumper" or "ident" on the end and things should start to pop up. Or maybe, if you felt so inclined, you could find the classification assets and create the content yourself! Just remember to share it with the rest of us! Final Thoughts: I'll be the first to admit that this is a SUPER hacky way of adding in custom ratings, but it's the only way to go about it for the time being. I've been told that it's been as simple as adding the XML with the values but it's clearly not that easy. Hopefully, now, others can start to jump through these pretty easy hoops and share it with the rest of us, or perhaps one brave warrior can go through and add every classification? Last I checked though, the GitHub is locked down so I'm not sure how we'd even distribute these files. In any case, this is my first guide so I really hope this doesn't crash when I try to post and that it's been helpful!
-
Until you support more ratings, I would like to write a guide on getting any country's rating system to work. What are the image and video file names that CV looks for? If this is known then creating your own rating bumpers and fooling CV into thinking they are known could work. E.g. if CV is looking for the MPAA Restricted video or image and it is looking for, say, "R.png" then you could put any image you like in the folder and call it R.png. Then you rescan your library to the MPAA rating (if it is currently another country's rating system), and Bob's your uncle.
-
A "default" rating file when none are present
a topic has posted Shilar in CinemaVision Add-on Feature Requests
Here's an idea. Make a default file that appears when no ratings are shown (for example, show "NR" when there is no rating).