ソースを参照

[tasks] Move to single context for task titles

Colin Powell 2 ヶ月 前
コミット
32ec65116b
2 ファイル変更5 行追加9 行削除
  1. 2 6
      vrobbler/apps/scrobbles/scrobblers.py
  2. 3 3
      vrobbler/apps/tasks/constants.py

+ 2 - 6
vrobbler/apps/scrobbles/scrobblers.py

@@ -421,10 +421,8 @@ def todoist_scrobble_task(
     # user.profile.task_context_tags which will result in context-based tag titles
     # We'd also have to migrate existing tasks to the new context based ones (maybe)
     for label in todoist_task["todoist_label_list"]:
-        if label in TODOIST_TITLE_PREFIX_LABELS:
-            prefix = label
-        if label in TODOIST_TITLE_SUFFIX_LABELS:
-            suffix = label
+        if label in TODOIST_TITLE_LABELS:
+            title = label
 
     if not prefix and suffix:
         logger.warning(
@@ -432,8 +430,6 @@ def todoist_scrobble_task(
             extra={"todoist_scrobble_task": todoist_task},
         )
 
-    title = " ".join([prefix.capitalize(), suffix.capitalize()])
-
     task = Task.find_or_create(title)
 
     timestamp = pendulum.parse(todoist_task.get("updated_at", timezone.now()))

+ 3 - 3
vrobbler/apps/tasks/constants.py

@@ -1,10 +1,10 @@
-TODOIST_TITLE_PREFIX_LABELS = ["work", "home", "personal"]
-TODOIST_TITLE_SUFFIX_LABELS = [
+TODOIST_TITLE_LABELS = [
     "bug",
-    "project",
+    "feature",
     "errand",
     "chore",
     "admin",
+    "baking",
     "meeting",
     "habit",
     "research",