Fix bug in end_ts calc for book scrobbles
This commit is contained in:
@ -228,9 +228,6 @@ def build_scrobbles_from_book_map(
|
|||||||
if seconds_from_last_page > SESSION_GAP_SECONDS or end_of_reading:
|
if seconds_from_last_page > SESSION_GAP_SECONDS or end_of_reading:
|
||||||
should_create_scrobble = True
|
should_create_scrobble = True
|
||||||
|
|
||||||
logger.info(
|
|
||||||
f"Book {koreader_book_id} - {page_number} {seconds_from_last_page} read seconds"
|
|
||||||
)
|
|
||||||
if should_create_scrobble:
|
if should_create_scrobble:
|
||||||
first_page = scrobble_page_data.get(
|
first_page = scrobble_page_data.get(
|
||||||
list(scrobble_page_data.keys())[0]
|
list(scrobble_page_data.keys())[0]
|
||||||
@ -239,9 +236,7 @@ def build_scrobbles_from_book_map(
|
|||||||
list(scrobble_page_data.keys())[-1]
|
list(scrobble_page_data.keys())[-1]
|
||||||
)
|
)
|
||||||
start_ts = int(first_page.get("start_ts"))
|
start_ts = int(first_page.get("start_ts"))
|
||||||
end_ts = int(last_page.get("start_ts")) + int(
|
end_ts = start_ts + playback_position_seconds
|
||||||
last_page.get("duration")
|
|
||||||
)
|
|
||||||
|
|
||||||
timestamp = datetime.fromtimestamp(start_ts).replace(
|
timestamp = datetime.fromtimestamp(start_ts).replace(
|
||||||
tzinfo=user.profile.tzinfo
|
tzinfo=user.profile.tzinfo
|
||||||
|
|||||||
Reference in New Issue
Block a user