@@ -53,6 +53,14 @@ def cast(self):
5353 star_ids = set (star ['id' ] for star in stars )
5454 return stars + [actor for actor in cast if actor ['id' ] not in star_ids ]
5555
56+ @property
57+ def mpaa_rating (self ):
58+ try :
59+ return self .movie .certificate .certificate
60+ except Exception :
61+ return 'Not rated'
62+
63+
5664 def summary (self ):
5765 return {
5866 'title' : get (self .movie , 'base' , 'title' ),
@@ -66,7 +74,7 @@ def summary(self):
6674 'genres' : get (self .movie , 'genres' , default = []),
6775 'cast' : self .cast ,
6876 'writers' : get (self .movie , 'credits' , 'writer' , default = []),
69- 'mpaa' : "" ,
77+ 'mpaa' : self . mpaa_rating ,
7078 'description' : self .description ,
7179 'url' : self .url ,
7280 'year' : get (self .movie , 'base' , 'year' )}
@@ -126,6 +134,7 @@ def get_info(self, imdb_id):
126134 movie .credits = f_credits .result ()['credits' ]
127135 movie .stars = f_aux .result ()['principals' ]
128136 movie .genres = f_genres .result ()['genres' ]
137+ movie .certificate = f_aux .result ().get ('certificate' )
129138 title_versions = f_versions .result ()
130139 movie .titles = {item ["region" ]: item ["title" ]
131140 for item in title_versions ['alternateTitles' ]
0 commit comments