From ad03f22b20fca5e152a90630ab28ed77d4f5d14c Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Wed, 11 Mar 2026 16:21:01 -0400 Subject: [PATCH] [koreader] Fix broken tests --- vrobbler/apps/books/koreader.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vrobbler/apps/books/koreader.py b/vrobbler/apps/books/koreader.py index 1058d8d..a9d0fad 100644 --- a/vrobbler/apps/books/koreader.py +++ b/vrobbler/apps/books/koreader.py @@ -298,6 +298,10 @@ def build_scrobbles_from_book_map(book_map: dict, user: "User") -> list["Scrobbl "page_data": scrobble_page_data, "pages_read": len(scrobble_page_data.keys()), } + if hasattr(timestamp.tzinfo, "tzname"): + tz = timestamp.tzinfo.tzname + if hasattr(timestamp.tzinfo, "name"): + tz = timestamp.tzinfo.name scrobbles_to_create.append( Scrobble( book_id=book_id, @@ -311,7 +315,7 @@ def build_scrobbles_from_book_map(book_map: dict, user: "User") -> list["Scrobbl in_progress=False, played_to_completion=True, long_play_complete=False, - timezone=timestamp.tzinfo.name, + timezone=tz, ) ) # Then start over