[locations] Don't scrobble all the locations!
This commit is contained in:
@ -802,6 +802,7 @@ class Scrobble(TimeStampedModel):
|
||||
def user_has_moved_locations(
|
||||
cls, location: GeoLocation, user_id: int
|
||||
) -> bool:
|
||||
moved_location = False
|
||||
scrobble = (
|
||||
cls.objects.filter(
|
||||
media_type=cls.MediaType.GEO_LOCATION, user_id=user_id
|
||||
@ -809,8 +810,20 @@ class Scrobble(TimeStampedModel):
|
||||
.order_by("-timestamp")
|
||||
.first()
|
||||
)
|
||||
if not scrobble:
|
||||
logger.info(
|
||||
f"[scrobbling] No existing location scrobbles, {location} should be created"
|
||||
)
|
||||
moved_location = True
|
||||
if scrobble and scrobble.media_obj != location:
|
||||
|
||||
else:
|
||||
if scrobble.media_obj == location:
|
||||
logger.info(
|
||||
f"[scrobbling] New location {location} and last location {scrobble.media_obj} are the same"
|
||||
)
|
||||
moved_location = False
|
||||
|
||||
if scrobble.media_obj != location:
|
||||
logger.info(
|
||||
f"[scrobbling] New location {location} and last location {scrobble.media_obj} are different"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user