From beb9569663d42b9c2ad0a98ea3ef390fe1dc2c63 Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Fri, 8 Mar 2024 14:52:01 -0500 Subject: [PATCH] [scrobbles] Try to fix mopidy double scrobbles --- vrobbler/apps/scrobbles/models.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vrobbler/apps/scrobbles/models.py b/vrobbler/apps/scrobbles/models.py index 8518b0f..cf52f4e 100644 --- a/vrobbler/apps/scrobbles/models.py +++ b/vrobbler/apps/scrobbles/models.py @@ -829,6 +829,7 @@ class Scrobble(TimeStampedModel): ) source = scrobble_data["source"] mtype = media.__class__.__name__ + mopidy_status = scrobble_data.get("mopidy_status", None) logger.info( f"[scrobbling] check for existing scrobble to update ", @@ -853,6 +854,9 @@ class Scrobble(TimeStampedModel): ) return scrobble + if mopidy_status == "stopped": + scrobble.stop() + if scrobble and scrobble.can_be_updated: return scrobble.update(scrobble_data)