From cc751d095338ab994ff9c57d8851d49fd4a1fcb3 Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Sun, 28 May 2023 10:25:34 -0400 Subject: [PATCH] Duplicate long play complete from last scrobble --- vrobbler/apps/videogames/retroarch.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vrobbler/apps/videogames/retroarch.py b/vrobbler/apps/videogames/retroarch.py index 0fb85b3..caf0311 100644 --- a/vrobbler/apps/videogames/retroarch.py +++ b/vrobbler/apps/videogames/retroarch.py @@ -125,7 +125,9 @@ def import_retroarch_lrtl_files(playlog_path: str, user_id: int) -> List[dict]: if found_scrobble: logger.info(f"Skipping scrobble for game {found_game.id}") continue + last_scrobble = found_game.scrobble_set.last() + long_play_complete = last_scrobble.long_play_complete # Default to 0 for delta, but if there's an past scrobble, use that delta_runtime = 0 @@ -150,6 +152,7 @@ def import_retroarch_lrtl_files(playlog_path: str, user_id: int) -> List[dict]: played_to_completion=True, in_progress=False, long_play_seconds=game_data["runtime"], + long_play_complete=long_play_complete, user_id=user_id, source="Retroarch", source_id="Imported from Retroarch play log file",