[tasks] Clean up emacs webhook flow
This commit is contained in:
@ -149,13 +149,6 @@ def emacs_webhook(request):
|
|||||||
post_data, user_id, started=task_in_progress, stopped=task_stopped
|
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:
|
if not scrobble:
|
||||||
logger.info(
|
logger.info(
|
||||||
"[emacs_webhook] finished with no note or task found",
|
"[emacs_webhook] finished with no note or task found",
|
||||||
@ -166,6 +159,13 @@ def emacs_webhook(request):
|
|||||||
status=status.HTTP_304_NOT_MODIFIED,
|
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(
|
logger.info(
|
||||||
"[emacs_webhook] finished",
|
"[emacs_webhook] finished",
|
||||||
extra={"scrobble_id": scrobble.id},
|
extra={"scrobble_id": scrobble.id},
|
||||||
|
|||||||
Reference in New Issue
Block a user