Ignore broken runtime variable in metadata
This commit is contained in:
parent
efaea4141c
commit
0702fc7580
@ -42,7 +42,6 @@ class MoviesCollection(BaseResource):
|
|||||||
"title_english":metadata["title"],
|
"title_english":metadata["title"],
|
||||||
"title_long":movie_path.name,
|
"title_long":movie_path.name,
|
||||||
"year":metadata["year"],
|
"year":metadata["year"],
|
||||||
"runtime": int(metadata["runtime"]) // 100,
|
|
||||||
"imdb_code": metadata["imdb_id"],
|
"imdb_code": metadata["imdb_id"],
|
||||||
"rating": metadata["rating"],
|
"rating": metadata["rating"],
|
||||||
"summary": metadata["plot_outline"],
|
"summary": metadata["plot_outline"],
|
||||||
@ -51,6 +50,10 @@ class MoviesCollection(BaseResource):
|
|||||||
"genres": metadata["genres"],
|
"genres": metadata["genres"],
|
||||||
"state": "ok"
|
"state": "ok"
|
||||||
}
|
}
|
||||||
|
try:
|
||||||
|
metadata["runtime"] = int(metadata["runtime"]) // 100
|
||||||
|
except ValueError as err:
|
||||||
|
pass
|
||||||
if metadata["plots"]:
|
if metadata["plots"]:
|
||||||
mobj["description_full"] = metadata["plots"][0]
|
mobj["description_full"] = metadata["plots"][0]
|
||||||
movies.append(mobj)
|
movies.append(mobj)
|
||||||
|
Loading…
Reference in New Issue
Block a user