From bf7d2514f256e48020fd1e6afc11e44a9eb210b0 Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Fri, 27 Jun 2025 11:50:30 -0400 Subject: [PATCH] [tasks] Clean up param names and loggin --- vrobbler/apps/scrobbles/scrobblers.py | 8 ++++---- vrobbler/apps/tasks/utils.py | 4 ++-- vrobbler/apps/tasks/webhooks.py | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/vrobbler/apps/scrobbles/scrobblers.py b/vrobbler/apps/scrobbles/scrobblers.py index 044085b..d41382c 100644 --- a/vrobbler/apps/scrobbles/scrobblers.py +++ b/vrobbler/apps/scrobbles/scrobblers.py @@ -409,9 +409,9 @@ def todoist_scrobble_task( user_id: int, started: bool = False, stopped: bool = False, - context_list: list[str] = [], + user_context_list: list[str] = [], ) -> Scrobble: - title = get_title_from_labels(todoist_task.get("todoist_label_list", []), context_list) + title = get_title_from_labels(todoist_task.get("todoist_label_list", []), user_context_list) task = Task.find_or_create(title) timestamp = pendulum.parse(todoist_task.get("updated_at", timezone.now())) @@ -533,10 +533,10 @@ def emacs_scrobble_task( user_id: int, started: bool = False, stopped: bool = False, - context_list: list[str] = [], + user_context_list: list[str] = [], ) -> Scrobble | None: source_id = task_data.get("source_id") - title = get_title_from_labels(task_data.get("labels", []), context_list) + title = get_title_from_labels(task_data.get("labels", []), user_context_list) task = Task.find_or_create(title) diff --git a/vrobbler/apps/tasks/utils.py b/vrobbler/apps/tasks/utils.py index 95f3868..09cb084 100644 --- a/vrobbler/apps/tasks/utils.py +++ b/vrobbler/apps/tasks/utils.py @@ -14,7 +14,7 @@ def get_title_from_labels(labels: list[str], user_context_labels: list[str] = [] if title == "Unknown": logger.warning( - "Missing a prefix and suffix tag for task", - extra={"labels": labels}, + "Missing a configured title context for task", + extra={"labels": labels, "task_context_labels": task_context_labels}, ) return title diff --git a/vrobbler/apps/tasks/webhooks.py b/vrobbler/apps/tasks/webhooks.py index 92aecfd..898dccb 100644 --- a/vrobbler/apps/tasks/webhooks.py +++ b/vrobbler/apps/tasks/webhooks.py @@ -100,7 +100,7 @@ def todoist_webhook(request): todoist_task, user_profile.user_id, stopped=task_stopped, - context_list=user_profile.task_context_tags, + user_context_list=user_profile.task_context_tags, ) if todoist_note: @@ -153,7 +153,7 @@ def emacs_webhook(request): user_id, started=task_in_progress, stopped=task_stopped, - context_list=user_profile.task_context_tags, + user_context_list=user_profile.task_context_tags, ) if not scrobble: