summaryrefslogtreecommitdiff
path: root/imdb-lookup/imdbinfo.py
diff options
context:
space:
mode:
authorYves Fischer <yvesf-git@xapek.org>2014-12-24 15:33:29 +0100
committerYves Fischer <yvesf-git@xapek.org>2014-12-24 15:33:29 +0100
commit79ba03a5a84a4ac5c526cb69f1337b2fdc876c54 (patch)
tree739c607acb07086bbbd4225c8c03472544e18830 /imdb-lookup/imdbinfo.py
parent3324414ec1299d5bedcb18314360eb242db2b69d (diff)
downloadscripts-79ba03a5a84a4ac5c526cb69f1337b2fdc876c54.tar.gz
scripts-79ba03a5a84a4ac5c526cb69f1337b2fdc876c54.zip
filtering
Diffstat (limited to 'imdb-lookup/imdbinfo.py')
-rwxr-xr-ximdb-lookup/imdbinfo.py15
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'],
}