From 84ec84c0185ac35e16b7367721420c0e2131b0b0 Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Fri, 8 Mar 2024 14:59:37 -0500 Subject: [PATCH] [scrobbles] Try fixing mopidy within existing framework --- vrobbler/apps/scrobbles/models.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/vrobbler/apps/scrobbles/models.py b/vrobbler/apps/scrobbles/models.py index cf52f4e..1ecd254 100644 --- a/vrobbler/apps/scrobbles/models.py +++ b/vrobbler/apps/scrobbles/models.py @@ -854,17 +854,16 @@ class Scrobble(TimeStampedModel): ) return scrobble - if mopidy_status == "stopped": - scrobble.stop() - - if scrobble and scrobble.can_be_updated: + if scrobble and ( + scrobble.can_be_updated or mopidy_status == "stopped" + ): return scrobble.update(scrobble_data) # Discard status before creating scrobble_data.pop("mopidy_status", None) scrobble_data.pop("jellyfin_status", None) logger.info( - f"[scrobbling] existing scrobble finished, creating new scrobble", + f"[scrobbling] creating new scrobble", extra={ "scrobble_id": scrobble.id if scrobble else None, "media_type": mtype,