From b981c090c616ceb291f3c773eae46bb7086efb2d Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Sun, 18 Feb 2024 11:42:42 -0500 Subject: [PATCH] [locations] Change name of model function --- vrobbler/apps/locations/models.py | 4 ++-- vrobbler/apps/scrobbles/models.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/vrobbler/apps/locations/models.py b/vrobbler/apps/locations/models.py index f1de065..f0c93d4 100644 --- a/vrobbler/apps/locations/models.py +++ b/vrobbler/apps/locations/models.py @@ -15,7 +15,7 @@ BNULL = {"blank": True, "null": True} User = get_user_model() GEOLOC_ACCURACY = int(getattr(settings, "GEOLOC_ACCURACY", 4)) -GEOLOC_PROXIMITY = Decimal(getattr(settings, "GEOLOC_PROXIMITY", "0.00001")) +GEOLOC_PROXIMITY = Decimal(getattr(settings, "GEOLOC_PROXIMITY", "0.0001")) class GeoLocation(ScrobblableMixin): @@ -107,7 +107,7 @@ class GeoLocation(ScrobblableMixin): return has_moved - def named_in_proximity(self, named=True) -> models.QuerySet: + def in_proximity(self, named=True) -> models.QuerySet: lat_min = Decimal(self.lat) - GEOLOC_PROXIMITY lat_max = Decimal(self.lat) + GEOLOC_PROXIMITY lon_min = Decimal(self.lon) - GEOLOC_PROXIMITY diff --git a/vrobbler/apps/scrobbles/models.py b/vrobbler/apps/scrobbles/models.py index dc06718..840c062 100644 --- a/vrobbler/apps/scrobbles/models.py +++ b/vrobbler/apps/scrobbles/models.py @@ -838,7 +838,7 @@ class Scrobble(TimeStampedModel): ) scrobble.stop(force_finish=True) - if existing_locations := location.named_in_proximity(): + if existing_locations := location.in_proximity(named=True): existing_location = existing_locations.first() logger.info( f"[scrobbling] moved to {location.id} but named location {existing_location.id} found, using it instead"