summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYves Fischer <yvesf-git@xapek.org>2014-12-11 00:09:10 +0100
committerYves Fischer <yvesf-git@xapek.org>2014-12-11 00:09:10 +0100
commit31bd935c3b0df3982fca080d0edd1ef8ba396c20 (patch)
tree8da62c201cf2c6c6bec3bcdf2d37747377c7aa9c
parenta4657a5aff417e0a03d6794c59725ddad0875ced (diff)
downloadscripts-31bd935c3b0df3982fca080d0edd1ef8ba396c20.tar.gz
scripts-31bd935c3b0df3982fca080d0edd1ef8ba396c20.zip
skip if some data is not available
-rw-r--r--imdb-lookup/index.jinja2.html6
1 files changed, 3 insertions, 3 deletions
diff --git a/imdb-lookup/index.jinja2.html b/imdb-lookup/index.jinja2.html
index b09abf1..e55c855 100644
--- a/imdb-lookup/index.jinja2.html
+++ b/imdb-lookup/index.jinja2.html
@@ -86,14 +86,14 @@
<body>
{% for (path, imdb_id) in input %}
{% set info = tmdbcache.infos(imdb_id) %}</h2>
- {% if info %}
+ {% set imdb_data = tmdbcache.imdb_movie(imdb_id)['data'] %}
+ {% set omdb_data = tmdbcache.omdb_movie(imdb_id) %}
+ {% if info and imdb_data and omdb_data %}
{% set year = int(info['release_date'].split('-')[0]) %}
{% set age = gmtime.tm_year - year %}
{% set centuries = int(age / 10) %}
{% set posterBase64 = tmdbcache.poster_base64(info['poster_path'],'w154') %}
{% set local_title = tmdbcache.alternative_title(imdb_id, "DE") %}
- {% set imdb_data = tmdbcache.imdb_movie(imdb_id)['data'] %}
- {% set omdb_data = tmdbcache.omdb_movie(imdb_id) %}
{% set votes = imdb_data['num_votes'] %}
{% set popularity = int( 9*(1 - (1+math.exp(-1))/(1+math.exp(votes/70000.0 -1 ))) + 1 ) %}
{% set fresh = (omdb_data.tomatoMeter != 'N/A') and int(omdb_data.tomatoMeter) or None %}