Sfoglia il codice sorgente

[locations] Change name of model function

Colin Powell 1 anno fa
parent
commit
b981c090c6
2 ha cambiato i file con 3 aggiunte e 3 eliminazioni
  1. 2 2
      vrobbler/apps/locations/models.py
  2. 1 1
      vrobbler/apps/scrobbles/models.py

+ 2 - 2
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

+ 1 - 1
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"