[scrobbling] Fix locations in proximity of named locations
This commit is contained in:
@ -955,20 +955,24 @@ class Scrobble(TimeStampedModel):
|
|||||||
)
|
)
|
||||||
return scrobble
|
return scrobble
|
||||||
|
|
||||||
scrobble.stop(force_finish=True)
|
|
||||||
|
|
||||||
if existing_locations := location.in_proximity(named=True):
|
if existing_locations := location.in_proximity(named=True):
|
||||||
existing_location = existing_locations.first()
|
existing_location = existing_locations.first()
|
||||||
|
scrobble.scrobble_log = (
|
||||||
|
scrobble.scrobble_log
|
||||||
|
+ "\nLocation {location.id} too close to this scrobble"
|
||||||
|
)
|
||||||
|
scrobble.save(update_fields=[scrobble_log])
|
||||||
logger.info(
|
logger.info(
|
||||||
f"[scrobbling] checking - found existing named location",
|
f"[scrobbling] finished - found existing named location",
|
||||||
extra={
|
extra={
|
||||||
"media_id": location.id,
|
"media_id": location.id,
|
||||||
"media_type": cls.MediaType.GEO_LOCATION,
|
"media_type": cls.MediaType.GEO_LOCATION,
|
||||||
"old_media_id": existing_location.id,
|
"old_media_id": existing_location.id,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
scrobble_data["geo_location"] = existing_location
|
return scrobble
|
||||||
|
|
||||||
|
scrobble.stop(force_finish=True)
|
||||||
scrobble = cls.create(scrobble_data)
|
scrobble = cls.create(scrobble_data)
|
||||||
logger.info(
|
logger.info(
|
||||||
f"[scrobbling] finished - created for location",
|
f"[scrobbling] finished - created for location",
|
||||||
|
|||||||
Reference in New Issue
Block a user