From 7697dd006d335725305adaafa0f5b6582dacbe75 Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Tue, 12 Mar 2024 11:43:15 -0400 Subject: [PATCH] [scrobbling] Futher clean up logging for locations --- vrobbler/apps/scrobbles/models.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/vrobbler/apps/scrobbles/models.py b/vrobbler/apps/scrobbles/models.py index b2a3770..b53d5b7 100644 --- a/vrobbler/apps/scrobbles/models.py +++ b/vrobbler/apps/scrobbles/models.py @@ -947,11 +947,11 @@ class Scrobble(TimeStampedModel): scrobble.stop(force_finish=True) logger.info( - f"[scrobbling] finish location scrobble, we've moved", + f"[scrobbling] finish location scrobble, moved from old location", extra={ "scrobble_id": scrobble.id, "media_type": cls.MediaType.GEO_LOCATION, - "location_id": location.id, + "media_id": location.id, }, ) @@ -960,22 +960,24 @@ class Scrobble(TimeStampedModel): logger.info( f"[scrobbling] has moved but found existing named location, using it", extra={ - "location_id": location.id, + "media_id": location.id, "media_type": cls.MediaType.GEO_LOCATION, "existing_location_id": existing_location.id, }, ) scrobble_data["geo_location"] = existing_location + scrobble = cls.create(scrobble_data) logger.info( - f"[scrobbling] creating for location from GPSLogger", + f"[scrobbling] created for location from GPSLogger", extra={ - "location_id": location.id, + "scrobble_id": scrobble.id, + "media_id": location.id, "scrobble_data": scrobble_data, "media_type": cls.MediaType.GEO_LOCATION, }, ) - return cls.create(scrobble_data) + return scrobble @classmethod def past_scrobbled_locations(