diff --git a/vrobbler/apps/tasks/constants.py b/vrobbler/apps/tasks/constants.py index adee049..4fca01c 100644 --- a/vrobbler/apps/tasks/constants.py +++ b/vrobbler/apps/tasks/constants.py @@ -1,4 +1,4 @@ -TODOIST_TITLE_LABELS = [ +DEFAULT_TASK_CONTEXT_LABELS = [ "bug", "feature", "errand", diff --git a/vrobbler/apps/tasks/utils.py b/vrobbler/apps/tasks/utils.py index acd9d0e..5ab626b 100644 --- a/vrobbler/apps/tasks/utils.py +++ b/vrobbler/apps/tasks/utils.py @@ -1,14 +1,16 @@ import logging -from tasks.constants import TODOIST_TITLE_LABELS +from tasks.constants import DEFAULT_TASK_CONTEXT_LABELS logger = logging.getLogger(__name__) -def get_title_from_labels(labels: list[str]) -> str: +def get_title_from_labels(labels: list[str], user_context_labels: list[str] = []) -> str: title = "Unknown" + task_context_labels: list = user_context_labels or DEFAULT_TASK_CONTEXT_LABELS for label in labels: - if label in TODOIST_TITLE_LABELS: + # TODO We may also want to take a user list of labels instead + if label in task_context_labels: title = label.capitalize() if title == "Unknown":