[tasks] Make tasks use user profile string
This commit is contained in:
@ -34,10 +34,6 @@ from videos.models import Video
|
||||
from tasks.utils import get_title_from_labels
|
||||
from webpages.models import WebPage
|
||||
|
||||
from vrobbler.apps.tasks.constants import (
|
||||
TODOIST_TITLE_LABELS
|
||||
)
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@ -413,9 +409,9 @@ def todoist_scrobble_task(
|
||||
user_id: int,
|
||||
started: bool = False,
|
||||
stopped: bool = False,
|
||||
context_list: list = [],
|
||||
) -> Scrobble:
|
||||
|
||||
title = get_title_from_labels(todoist_task.get("todoist_label_list", []))
|
||||
title = get_title_from_labels(todoist_task.get("todoist_label_list", []), context_list)
|
||||
task = Task.find_or_create(title)
|
||||
|
||||
timestamp = pendulum.parse(todoist_task.get("updated_at", timezone.now()))
|
||||
@ -537,13 +533,10 @@ def emacs_scrobble_task(
|
||||
user_id: int,
|
||||
started: bool = False,
|
||||
stopped: bool = False,
|
||||
context_list: list[str] = [],
|
||||
) -> Scrobble | None:
|
||||
|
||||
prefix = ""
|
||||
suffix = ""
|
||||
|
||||
source_id = task_data.get("source_id")
|
||||
title = get_title_from_labels(task_data.get("labels", []))
|
||||
title = get_title_from_labels(task_data.get("labels", []), context_list)
|
||||
|
||||
task = Task.find_or_create(title)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user