From a5f24cd5ec97c5bd2a94b00768ec9b99169ba5b6 Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Mon, 6 Mar 2023 01:06:02 -0500 Subject: [PATCH] Fix minor issue in saving book scrobbles --- vrobbler/apps/scrobbles/models.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/vrobbler/apps/scrobbles/models.py b/vrobbler/apps/scrobbles/models.py index 2421f8e..88278dd 100644 --- a/vrobbler/apps/scrobbles/models.py +++ b/vrobbler/apps/scrobbles/models.py @@ -612,9 +612,11 @@ class Scrobble(TimeStampedModel): played_to_completion=True, long_play_complete=False, ).last() - self.video_game_minutes_played = ( - int(last_scrobble.playback_position) + updated_playback - ) + self.video_game_minutes_played = int(updated_playback) + if last_scrobble: + self.video_game_minutes_played = ( + int(last_scrobble.playback_position) + updated_playback + ) self.playback_position = int(updated_playback) self.played_to_completion = True