lpat2001 / movie-renamer

Automatically exported from code.google.com/p/movie-renamer
0 stars 0 forks source link

MPAA #37

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
It would be nice if you could add the MPAA rating in the title like you have 
the imdb rating.  It would make it easier to find kid movies and could block 
rated R or UR movies from them.

open source code for Zeeb does this so you might be able to see how they do it 
(requires adobe air)

Original issue reported on code.google.com by bird....@gmail.com on 15 Mar 2013 at 11:40

GoogleCodeExporter commented 8 years ago
Yes, it's a good idea.
I need to get information about this, because MPAA is only in USA (maybe i'm 
wrong), for example in Europe the name is PEGI and it's not the same "scale" as 
MPAA rating.

I will add it, and try to support all rating scale that i can found.

Original comment by nico.ma...@gmail.com on 18 Mar 2013 at 12:07

GoogleCodeExporter commented 8 years ago
Not sure if this will help.  I think this is java which you are using?  Anyway 
here is some code from another open project.  You will notice i selected only 
the mpaa part from the code and link is included at the bottom

private boolean extractCertificationFromMPAA;

extractCertificationFromMPAA = 
PropertiesUtil.getBooleanProperty("imdb.getCertificationFromMPAA", TRUE);

        if (OverrideTools.checkOverwriteCertification(movie, IMDB_PLUGIN_ID)) {
            String certification = movie.getCertification();
            if (extractCertificationFromMPAA) {
                String mpaa = HTMLTools.extractTag(xml, "<h5><a href=\"/mpaa\">MPAA</a>:</h5>", 1);
                if (StringTools.isValidString(mpaa)) {
                    String key = siteDef.getRated() + " ";
                    int pos = mpaa.indexOf(key);
                    if (pos != -1) {
                        int start = key.length();
                        pos = mpaa.indexOf(" on appeal for ", start);
                        if (pos == -1) {
                            pos = mpaa.indexOf(" for ", start);
                        }
                        if (pos != -1) {
                            certification = mpaa.substring(start, pos);
                        }
                    }
                }
            }

        // CERTIFICATION
        if (OverrideTools.checkOverwriteCertification(movie, IMDB_PLUGIN_ID)) {
            String certification = movie.getCertification();
            String certXML = webBrowser.request(getImdbUrl(movie, siteDef2) + "parentalguide#certification", siteDef2.getCharset());
            if (extractCertificationFromMPAA) {
                String mpaa = HTMLTools.extractTag(certXML, "<h5><a href=\"/mpaa\">MPAA</a>:</h5>", 1);
                if (!mpaa.equals(Movie.UNKNOWN)) {
                    String key = siteDef2.getRated() + " ";
                    int pos = mpaa.indexOf(key);
                    if (pos != -1) {
                        int start = key.length();
                        pos = mpaa.indexOf(" on appeal for ", start);
                        if (pos == -1) {
                            pos = mpaa.indexOf(" for ", start);
                        }
                        if (pos != -1) {
                            certification = mpaa.substring(start, pos);
                        }
                    }
                }
            }

http://code.google.com/p/moviejukebox/source/browse/branches/PriorityChecks/yamj
/src/main/java/com/moviejukebox/plugin/ImdbPlugin.java?r=3362#38

Original comment by bird....@gmail.com on 18 Mar 2013 at 7:30

GoogleCodeExporter commented 8 years ago
Thanks, but i don't need this because we've got another approach to extract 
information.

Get mpaa rating is not a problem, the most difficult part is to find equivalent 
depending of countries.

NB : Yes, Movie Renamer is in Java.
NB : I made a mistake PEGI is for video game not movies :-)

Original comment by nico.ma...@gmail.com on 18 Mar 2013 at 9:10