[locations] Change name of model function

This commit is contained in:
2024-02-18 11:42:42 -05:00
parent 605435b9ea
commit b981c090c6
2 changed files with 3 additions and 3 deletions

View File

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

View File

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