Ticket #4180: imdbpatch.3.patch

File imdbpatch.3.patch, 1.9 KB (added by robert.mcnamara@…, 16 years ago)

New version of patch to work with SVN revision 15154

  • mythvideo/mythvideo/scripts/imdb.pl

     
    201201       $movierating = parseBetween($movierating, ">", "<");
    202202   }
    203203
     204   # Convert MPAA Rating into Parental Rating
     205   my $parentalrating;
     206   if ($movierating =~ m/USA:G|Rated G|TV-Y|TV-G|UK:U/i) {
     207       $parentalrating = "1"
     208       }
     209   elsif ($movierating =~ m/USA:PG-13|Rated PG-13|Rated PG13|TV-14|UK:12|UK:15/i) {
     210       $parentalrating = "3"
     211       }
     212   elsif ($movierating =~ m/USA:PG|Rated PG|TV-PG|UK:PG/i) {
     213       $parentalrating = "2"
     214       }
     215   elsif ($movierating =~ m/USA:R|Rated R|UK:18|USA:NC-17|Rated NC-17|Rated NC17|USA:X|Rated X|TV-MA|UK:18|UK:R18/i) {
     216       $parentalrating = "4"
     217       }
     218   else
     219       {
     220       $parentalrating = "1"
     221       }
     222
    204223   # parse movie length
    205224   my $rawruntime = trim(parseBetween($response, ">Runtime:</h5>", "</div>"));
    206225   my $runtime = trim(parseBetween($rawruntime, "", " min"));
     
    246265   print "Cast: $cast\n";
    247266   print "Genres: $lgenres\n";
    248267   print "Countries: $lcountries\n";
     268   print "ParentalRating: $parentalrating\n";
    249269}
    250270
    251271# dump Movie Poster
  • mythvideo/mythvideo/videomanager.cpp

     
    18911891            item->setUserRating(data["UserRating"].toFloat());
    18921892            item->setRating(data["MovieRating"]);
    18931893            item->setLength(data["Runtime"].toInt());
    1894 
    1895             //movieGenres
     1894            item->setShowLevel(ParentalLevel::Level (data["ParentalRating"].toInt()));
     1895           
     1896            //movieGenres
    18961897            Metadata::genre_list movie_genres;
    18971898            QStringList genres = QStringList::split(",", data["Genres"]);
    18981899