Pārlūkot izejas kodu

[tasks] Clean up emacs webhook flow

Colin Powell 5 mēneši atpakaļ
vecāks
revīzija
73838312cd
1 mainītis faili ar 7 papildinājumiem un 7 dzēšanām
  1. 7 7
      vrobbler/apps/tasks/webhooks.py

+ 7 - 7
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},