[tasks] Fix bug in emacs labels
This commit is contained in:
@ -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(
|
||||
|
||||
@ -4,6 +4,8 @@ TODOIST_TITLE_LABELS = [
|
||||
"errand",
|
||||
"chore",
|
||||
"admin",
|
||||
"computer",
|
||||
"farm",
|
||||
"baking",
|
||||
"meeting",
|
||||
"habit",
|
||||
|
||||
Reference in New Issue
Block a user