diff options
Diffstat (limited to 'imdb-lookup/index.jinja2.html')
-rw-r--r-- | imdb-lookup/index.jinja2.html | 39 |
1 files changed, 24 insertions, 15 deletions
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 ) %} <div class="box"> <table> <tr> {% if "vote_average" in info.keys() %} - <td class="td1"> + <td class="td1" title="TMDB Rating"> <span class="off">{{ " ".join(["☆"] * (10-int(info["vote_average"]))) }}</span> <span class="on">{{ " ".join(["★"] * int(info["vote_average"])) }}</span> + <span class="num">{{info["vote_average"]}}</span> + </td> + <td class="td2" title="IMDB Rating"> + <span class="off">{{ " ".join(["☆"] * (10-int(imdb_data["rating"]))) }}</span> + <span class="on">{{ " ".join(["★"] * int(imdb_data["rating"])) }}</span> + <span class="num">{{imdb_data["rating"]}}</span> </td> - <!-- - <td class="td2"> - <span class="off">{{ " ".join(["☆"] * (10-int(info["popularity"]*10))) }}</span> - <span class="on">{{ " ".join(["★"] * int(info["popularity"]*10)) }}</span> + <td class="td3" title="IMDB Popularity"> + <span class="off">{{ " ".join(["☆"] * (10-popularity)) }}</span> + <span class="on">{{ " ".join(["★"] * popularity) }}</span> </td> - --> - <td class="td3"> - <span class="off">{{ " ".join([" "] * (10-centuries)) }}</span> - <span class="on">{{ " ".join(["⌚"] * centuries) }}</span> + <td class="td4" title="Centuries since release"> + <span class="off">{{ " ".join([" "] * (9-centuries)) }}</span> + <span class="on">{{ " ".join(["⌚"] * (centuries + 1)) }}</span> </td> {% endif %} <td class="poster"> @@ -92,7 +101,7 @@ <td>{{ info['runtime'] }}</td> </tr> {% endif %} - {% if 'homepage' in info %} + {% if 'homepage' in info and info['homepage'] %} <tr> <td style="font-style: italic">Homepage</td> <td><a href="{{ info['homepage'] }}">{{ info['homepage'] }}</a></td> @@ -104,13 +113,13 @@ </tr> <tr> <td colspan="2"> - <a href="http://www.themoviedb.org/movie/{{ info.id }}" rel="noreferrer">→ themoviedb.org</a> + → <a href="http://www.themoviedb.org/movie/{{ info.id }}" rel="noreferrer">themoviedb.org</a>   - <a href="http://www.imdb.com/title/{{ info.imdb_id }}" rel="noreferrer">→ imdb.com</a> + → <a href="http://www.imdb.com/title/{{ info.imdb_id }}" rel="noreferrer">imdb.com</a>   - <a href="http://letterboxd.com/tmdb/{{ info.id }}" rel="noreferrer">→ letterboxd.com</a> + → <a href="http://letterboxd.com/tmdb/{{ info.id }}" rel="noreferrer">letterboxd.com</a>   - <a href="http://www.ofdb.de/view.php?page=suchergebnis&Kat=IMDb&SText={{ info.imdb_id }}" rel="noreferrer">→ ofdb.db</a> + → <a href="http://www.ofdb.de/view.php?page=suchergebnis&Kat=IMDb&SText={{ info.imdb_id }}" rel="noreferrer">ofdb.db</a> </td> </tr> </table> |