@JSWolf Yep? Very incorect.
Try that:
Code:
python:
from calibre.gui2.library.bookshelf_view import width_from_pages
def evaluate(book, context):
val = book.get('#pages')
try:
pages = max(0, int(val))
except Exception:
return '0.4'
return str(width_from_pages(pages, num_of_pages_for_max_width=1500))
EDIT: Ah, seem you fix it on own.