From 1866b43cbe9e14450cb144d1d9b1cfd00ef59fb0 Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Sat, 2 May 2026 11:49:54 -0400 Subject: [PATCH] [locations] Shim fix for logdata for GeoLocs --- vrobbler/apps/scrobbles/models.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/vrobbler/apps/scrobbles/models.py b/vrobbler/apps/scrobbles/models.py index 5526456..5102aab 100644 --- a/vrobbler/apps/scrobbles/models.py +++ b/vrobbler/apps/scrobbles/models.py @@ -635,6 +635,20 @@ class Scrobble(TimeStampedModel): if not log_dict: log_dict = {} + # Special handling for GeoLocationLogData - data is nested under 'movement_detection' + # TODO there's a better way to fix this this at the LogData level + if logdata_cls.__name__ == "GeoLocationLogData": + instance_data = log_dict.get("movement_detection", {}).copy() + # Add top-level fields that GeoLocationLogData expects from BaseLogData/WithPeopleLogData + for field_name in ["description", "notes", "with_people_ids"]: + if field_name in log_dict: + instance_data[field_name] = log_dict[field_name] + try: + return logdata_cls(**instance_data) + except Exception as e: + logger.warning("Log data could not be loaded", e) + return logdata_cls() + try: return logdata_cls(**log_dict) except ParseError as e: