Fix for #3021 (speed of calculating number of pages)

This commit is contained in:
Ozzie Isaacs 2024-04-07 18:49:18 +02:00
parent fcc95bd895
commit 15952a764c

View File

@ -839,8 +839,7 @@ class CalibreDB:
entries = list() entries = list()
pagination = list() pagination = list()
try: try:
pagination = Pagination(page, pagesize, pagination = Pagination(page, pagesize, query.count())
len(query.all()))
entries = query.order_by(*order).offset(off).limit(pagesize).all() entries = query.order_by(*order).offset(off).limit(pagesize).all()
except Exception as ex: except Exception as ex:
log.error_or_exception(ex) log.error_or_exception(ex)