summaryrefslogtreecommitdiff
path: root/imdb-lookup
diff options
context:
space:
mode:
authorThomas Keck <thomas@thinkpad>2014-11-15 22:12:17 +0100
committerThomas Keck <thomas@thinkpad>2014-11-15 22:12:17 +0100
commitece9d3b2ed629f384e5b4605f840bb1aebaf071c (patch)
treebdbdf538b42774ca61806ef268e0cce9b8a6c5eb /imdb-lookup
parent87ab025dfe883916820ecd51fd88974cabd3eb04 (diff)
downloadscripts-ece9d3b2ed629f384e5b4605f840bb1aebaf071c.tar.gz
scripts-ece9d3b2ed629f384e5b4605f840bb1aebaf071c.zip
Ignore rating 0 and try to get rating again
Diffstat (limited to 'imdb-lookup')
-rwxr-xr-ximdb-lookup/imdbrating.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/imdb-lookup/imdbrating.py b/imdb-lookup/imdbrating.py
index de4c167..662b8d9 100755
--- a/imdb-lookup/imdbrating.py
+++ b/imdb-lookup/imdbrating.py
@@ -45,7 +45,7 @@ if __name__ == u"__main__":
for filename in sys.argv[1:]:
imdb_id = filename.split('#')[-1]
- if imdb_id not in db.keys():
+ if imdb_id not in db.keys() or db[imdb_id] == 0:
db[imdb_id] = str(get_rating(imdb_id))
- print db[imdb_id]
+ print u"{rating} {filename}".format(rating=db[imdb_id], filename=filename.decode('utf-8'))
db.close()