From 59d681dc007c69929a39995a513872515cc48616 Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Fri, 1 Nov 2024 12:59:53 -0400 Subject: [PATCH] [task] Ooops, add task id --- vrobbler/apps/scrobbles/scrobblers.py | 6 ++---- vrobbler/apps/tasks/webhooks.py | 3 ++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/vrobbler/apps/scrobbles/scrobblers.py b/vrobbler/apps/scrobbles/scrobblers.py index 4e68c4c..b257fa9 100644 --- a/vrobbler/apps/scrobbles/scrobblers.py +++ b/vrobbler/apps/scrobbles/scrobblers.py @@ -324,7 +324,7 @@ def todoist_scrobble_update_task( scrobble = Scrobble.objects.filter( in_progress=True, user_id=user_id, - log__task_id=todoist_note.get("task_id"), + log__todoist_id=todoist_note.get("task_id"), ).first() if not scrobble: @@ -339,9 +339,7 @@ def todoist_scrobble_update_task( return existing_notes = scrobble.log.get("notes", {}) - existing_notes[todoist_note.get("todoist_id")] = todoist_note.get( - "content" - ) + existing_notes[todoist_note.get("todoist_id")] = todoist_note.get("notes") scrobble.log["notes"] = existing_notes scrobble.save(update_fields=["log"]) logger.info( diff --git a/vrobbler/apps/tasks/webhooks.py b/vrobbler/apps/tasks/webhooks.py index 23ad721..0d9c793 100644 --- a/vrobbler/apps/tasks/webhooks.py +++ b/vrobbler/apps/tasks/webhooks.py @@ -61,7 +61,8 @@ def todoist_webhook(request): if is_note_type and is_added: task_data = event_data.get("item", {}) todoist_note = { - "todoist_id": task_data.get("id"), + "task_id": event_data.get("item_id"), + "todoist_id": event_data.get("id"), "todoist_label_list": task_data.get("labels"), "todoist_type": todoist_type, "todoist_event": todoist_event,