View Single Post
Old 01-02-2026, 12:17 PM   #33
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 82,250
Karma: 150871427
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by un_pogaz View Post
@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.
Yes, I did manage to fix the template. Thanks.

Now to make calibre count into the column I want. I want calibre's count to go into #pages instead o I don't need two of them {pages}. Then I can overwrite the count with Count Pages when I want. I'm also hoping to do away with {Pages} as that's an extra column that I won't need as I already have a page count column. I don't need two columns that do the same thing.

Last edited by JSWolf; 01-02-2026 at 12:22 PM.
JSWolf is offline   Reply With Quote