From fba188c746e7326de9d662cfac3b548466af90b3 Mon Sep 17 00:00:00 2001 From: Yves Fischer Date: Tue, 25 Nov 2014 23:03:37 +0100 Subject: imdb data --- imdb-lookup/index.jinja2.html | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) (limited to 'imdb-lookup/index.jinja2.html') diff --git a/imdb-lookup/index.jinja2.html b/imdb-lookup/index.jinja2.html index 6eae465..ff94348 100644 --- a/imdb-lookup/index.jinja2.html +++ b/imdb-lookup/index.jinja2.html @@ -16,14 +16,16 @@ .error { background-color: #EFAAAA; } - .td1, .td2, .td3 { + .td1, .td2, .td3, .td4 { width: 1em; font-size: 18pt; padding: 5px; + vertical-align: top; } .td1 .on { color: #ffd700; } .td2 .on { color: blue; } .td1, .td2 .off { color: gray; } + .td1 .num, .td2 .num { font-size: 12pt; color: gray; } .poster { margin: 10px; width: 185px; @@ -51,23 +53,30 @@ {% set age = gmtime.tm_year - int(info['release_date'].split('-')[0]) %} {% set centuries = int(age / 10) %} {% set posterBase64 = tmdbcache.poster_base64(info['poster_path']) %} + {% set imdb_data = tmdbcache.imdb_movie(imdb_id)['data'] %} + {% set votes = imdb_data['num_votes'] %} + {% set popularity = int( 9*(1 - (1+math.exp(-1))/(1+math.exp(votes/70000.0 -1 ))) + 1 ) %}
{% if "vote_average" in info.keys() %} - + - - {% endif %} {% endif %} - {% if 'homepage' in info %} + {% if 'homepage' in info and info['homepage'] %} @@ -104,13 +113,13 @@
+ {{ " ".join(["☆"] * (10-int(info["vote_average"]))) }} {{ " ".join(["★"] * int(info["vote_average"])) }} + {{info["vote_average"]}} + + {{ " ".join(["☆"] * (10-int(imdb_data["rating"]))) }} + {{ " ".join(["★"] * int(imdb_data["rating"])) }} + {{imdb_data["rating"]}} - {{ " ".join(["  "] * (10-centuries)) }} - {{ " ".join(["⌚"] * centuries) }} + + {{ " ".join(["  "] * (9-centuries)) }} + {{ " ".join(["⌚"] * (centuries + 1)) }} @@ -92,7 +101,7 @@ {{ info['runtime'] }}
Homepage {{ info['homepage'] }}
- → themoviedb.org + → themoviedb.org   - → imdb.com + → imdb.com   - → letterboxd.com + → letterboxd.com   - → ofdb.db + → ofdb.db
-- cgit v1.2.1