rating报错问题
This commit is contained in:
parent
fc4335717e
commit
18086a604f
|
@ -24,7 +24,10 @@ class Douban(Metadata):
|
|||
v['publisher'] = r.get('publisher', "")
|
||||
v['publishedDate'] = r.get('pubdate', "")
|
||||
v['tags'] = [tag.get('name', '') for tag in r.get('tags', [])]
|
||||
v['rating'] = float(r['rating'].get('average', '0')) / 2
|
||||
rating = r['rating'].get('average', '0')
|
||||
if not rating:
|
||||
rating = '0'
|
||||
v['rating'] = float(rating) / 2
|
||||
if r.get('image'):
|
||||
v['cover'] = r.get('image')
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue