From 73838312cd993cbbf91f5530a880672d7f8a417a Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Tue, 10 Jun 2025 11:06:47 -0400 Subject: [PATCH] [tasks] Clean up emacs webhook flow --- vrobbler/apps/tasks/webhooks.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/vrobbler/apps/tasks/webhooks.py b/vrobbler/apps/tasks/webhooks.py index 68225fc..538ed4a 100644 --- a/vrobbler/apps/tasks/webhooks.py +++ b/vrobbler/apps/tasks/webhooks.py @@ -149,13 +149,6 @@ def emacs_webhook(request): post_data, user_id, started=task_in_progress, stopped=task_stopped ) - if scrobble and task_in_progress and post_data.get("notes"): - emacs_scrobble_update_task( - post_data.get("source_id"), - post_data.get("notes"), - user_id, - ) - if not scrobble: logger.info( "[emacs_webhook] finished with no note or task found", @@ -166,6 +159,13 @@ def emacs_webhook(request): status=status.HTTP_304_NOT_MODIFIED, ) + if task_in_progress and post_data.get("notes"): + emacs_scrobble_update_task( + post_data.get("source_id"), + post_data.get("notes"), + user_id, + ) + logger.info( "[emacs_webhook] finished", extra={"scrobble_id": scrobble.id},