Prechádzať zdrojové kódy

[tasks] Fix bug in emacs labels

Colin Powell 2 mesiacov pred
rodič
commit
c68b0e9d7e

+ 4 - 7
vrobbler/apps/scrobbles/scrobblers.py

@@ -34,8 +34,7 @@ from videos.models import Video
 from webpages.models import WebPage
 
 from vrobbler.apps.tasks.constants import (
-    TODOIST_TITLE_PREFIX_LABELS,
-    TODOIST_TITLE_SUFFIX_LABELS,
+    TODOIST_TITLE_LABELS
 )
 
 logger = logging.getLogger(__name__)
@@ -557,11 +556,9 @@ def emacs_scrobble_task(
     suffix = ""
 
     source_id = task_data.get("source_id")
-    for label in task_data.get("labels"):
-        if label in TODOIST_TITLE_PREFIX_LABELS:
-            prefix = label
-        if label in TODOIST_TITLE_SUFFIX_LABELS:
-            suffix = label
+    for label in task_data.get("labels", []):
+        if label in TODOIST_TITLE_LABELS:
+            title = label
 
     if not prefix and not suffix:
         logger.warning(

+ 2 - 0
vrobbler/apps/tasks/constants.py

@@ -4,6 +4,8 @@ TODOIST_TITLE_LABELS = [
     "errand",
     "chore",
     "admin",
+    "computer",
+    "farm",
     "baking",
     "meeting",
     "habit",