mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Cover grid: Fix text showing 'None' for rating fields for books with no rating
This commit is contained in:
parent
805dd105a5
commit
c6dadb7100
@ -379,8 +379,8 @@ class CoverDelegate(QStyledItemDelegate):
|
|||||||
mi = db.get_proxy_metadata(book_id)
|
mi = db.get_proxy_metadata(book_id)
|
||||||
display_name, ans, val, fm = mi.format_field_extended(field)
|
display_name, ans, val, fm = mi.format_field_extended(field)
|
||||||
if fm and fm['datatype'] == 'rating':
|
if fm and fm['datatype'] == 'rating':
|
||||||
ans = u'\u2605' * int(val/2.0)
|
ans = u'\u2605' * int(val/2.0) if val is not None else ''
|
||||||
return unicode(ans)
|
return '' if ans is None else unicode(ans)
|
||||||
except Exception:
|
except Exception:
|
||||||
if DEBUG:
|
if DEBUG:
|
||||||
import traceback
|
import traceback
|
||||||
|
Loading…
x
Reference in New Issue
Block a user