Duplicate long play complete from last scrobble

This commit is contained in:
2023-05-28 10:25:34 -04:00
parent a7e8e4f1dc
commit cc751d0953

View File

@ -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",