diff options
Diffstat (limited to 'imdb-lookup/imdbinfo.py')
-rwxr-xr-x | imdb-lookup/imdbinfo.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/imdb-lookup/imdbinfo.py b/imdb-lookup/imdbinfo.py index 370e124..fe4bd60 100755 --- a/imdb-lookup/imdbinfo.py +++ b/imdb-lookup/imdbinfo.py @@ -336,6 +336,16 @@ def do_index(args, imdb_ids): return out else: return None + + def compile_summary(imdb,omdb,tmdb): + buf = [] + if "directors_summary" in imdb: + buf += ["By " + ", ".join(map(lambda i: i["name"]["name"], imdb["directors_summary"]))] + if "cast_summary" in imdb: + buf += ["Starring: " + ", ".join(map(lambda i: i["name"]["name"], imdb["cast_summary"]))] + if omdb["Rated"] != "N/A": + buf += ["Rated: " + omdb["Rated"]] + return ". ".join(buf) path, imdb_id = a db = Protector(TMDBCache()) @@ -349,6 +359,7 @@ def do_index(args, imdb_ids): return { 'id': imdb_id, 'title': tmdb['title'], + 'summary': compile_summary(imdb, omdb, tmdb), 'poster': poster(imdb_id), 'tagline': 'tagline' in imdb and imdb['tagline'] or None, 'plot': 'plot' in imdb and imdb['plot']['outline'] or None, @@ -359,10 +370,8 @@ def do_index(args, imdb_ids): 'imdbRating': imdb['rating'], 'imdbVotes': imdb['num_votes'], 'omdbTomatoConsensus': (omdb['tomatoConsensus'] != 'N/A') and omdb['tomatoConsensus'] or None, - 'omdbTomato': (omdb['tomatoMeter'] != 'N/A') and float(omdb['tomatoMeter']) or None, - 'omdbUserTomato': (omdb['tomatoUserMeter'] != 'N/A') and float(omdb['tomatoUserMeter']) or None, + 'omdbTomatoMeter': (omdb['tomatoMeter'] != 'N/A') and float(omdb['tomatoMeter']) or None, 'omdbTomatoRating': (omdb['tomatoRating'] != 'N/A') and float(omdb['tomatoRating']) or None, - 'omdbTomatoUserRating': (omdb['tomatoUserRating'] != 'N/A') and float(omdb['tomatoUserRating']) or None, 'tmdbId': tmdb['id'], } |