|
@@ -348,11 +348,16 @@ def todoist_scrobble_task(todoist_task: dict, user_id: int) -> Scrobble:
|
|
|
|
|
|
task = Task.find_or_create(title)
|
|
|
in_progress_scrobble = Scrobble.objects.filter(
|
|
|
- in_progress=True, log__todoist_id=todoist_task.get("todoist_id")
|
|
|
+ in_progress=True,
|
|
|
+ log__todoist_id=todoist_task.get("todoist_id"),
|
|
|
+ task=task,
|
|
|
).first()
|
|
|
if in_progress_scrobble:
|
|
|
return in_progress_scrobble
|
|
|
|
|
|
+ if "inprogress" not in todoist_task["todoist_label_list"]:
|
|
|
+ return todoist_scrobble_task_finish(todoist_task, user_id)
|
|
|
+
|
|
|
# TODO Should use updated_at from TOdoist, but parsing isn't working
|
|
|
scrobble_dict = {
|
|
|
"user_id": user_id,
|