@@ -489,7 +489,7 @@ def get_statistics(
489489 for author_name in top_author_names :
490490 max_slots = min (5 , author_counts [author_name ])
491491 cover_rows = session .exec (
492- select (Book .id , Book .reading_status , Book .cover_url )
492+ select (Book .id , Book .title , Book . reading_status , Book .cover_url )
493493 .where (
494494 Book .user_id == current_user .id ,
495495 Book .author == author_name ,
@@ -499,14 +499,14 @@ def get_statistics(
499499 .limit (max_slots )
500500 ).all ()
501501 results = [
502- TopAuthorCover (book_id = book_id , reading_status = reading_status , cover_url = cover_url )
503- for book_id , reading_status , cover_url in cover_rows
502+ TopAuthorCover (book_id = book_id , title = title , reading_status = reading_status , cover_url = cover_url )
503+ for book_id , title , reading_status , cover_url in cover_rows
504504 if book_id is not None
505505 ]
506506 remaining = max_slots - len (results )
507507 if remaining > 0 :
508508 no_cover_rows = session .exec (
509- select (Book .id , Book .reading_status , Book .cover_url )
509+ select (Book .id , Book .title , Book . reading_status , Book .cover_url )
510510 .where (
511511 Book .user_id == current_user .id ,
512512 Book .author == author_name ,
@@ -516,8 +516,8 @@ def get_statistics(
516516 .limit (remaining )
517517 ).all ()
518518 results .extend (
519- TopAuthorCover (book_id = book_id , reading_status = reading_status , cover_url = cover_url )
520- for book_id , reading_status , cover_url in no_cover_rows
519+ TopAuthorCover (book_id = book_id , title = title , reading_status = reading_status , cover_url = cover_url )
520+ for book_id , title , reading_status , cover_url in no_cover_rows
521521 if book_id is not None
522522 )
523523 covers_by_author [author_name ] = results
0 commit comments