[tasks] Fix bug in emacs labels

This commit is contained in:
2025-06-24 10:52:47 -04:00
parent 32ec65116b
commit c68b0e9d7e
2 changed files with 6 additions and 7 deletions

View File

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

View File

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