Fix for #3021 (speed of calculating number of pages)
This commit is contained in:
		
							parent
							
								
									fcc95bd895
								
							
						
					
					
						commit
						15952a764c
					
				| 
						 | 
					@ -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)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user