From 0702fc75807e06809f258fb41227da4054e88544 Mon Sep 17 00:00:00 2001 From: Arti Zirk Date: Tue, 1 Nov 2016 23:11:39 +0200 Subject: [PATCH] Ignore broken runtime variable in metadata --- api/karumedia/controllers.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/karumedia/controllers.py b/api/karumedia/controllers.py index 113b6e2..a43a0be 100644 --- a/api/karumedia/controllers.py +++ b/api/karumedia/controllers.py @@ -42,7 +42,6 @@ class MoviesCollection(BaseResource): "title_english":metadata["title"], "title_long":movie_path.name, "year":metadata["year"], - "runtime": int(metadata["runtime"]) // 100, "imdb_code": metadata["imdb_id"], "rating": metadata["rating"], "summary": metadata["plot_outline"], @@ -51,6 +50,10 @@ class MoviesCollection(BaseResource): "genres": metadata["genres"], "state": "ok" } + try: + metadata["runtime"] = int(metadata["runtime"]) // 100 + except ValueError as err: + pass if metadata["plots"]: mobj["description_full"] = metadata["plots"][0] movies.append(mobj)