Skip to content

Commit

Permalink
bring props back
Browse files Browse the repository at this point in the history
  • Loading branch information
mrvladus committed May 8, 2024
1 parent 8975220 commit ad42252
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 59 deletions.
10 changes: 10 additions & 0 deletions errands/lib/sync/providers/caldav.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,19 @@ def __get_tasks(self, calendar: Calendar) -> list[TaskData]:
if todo.icalendar_component.get("status", "") == "COMPLETED"
else False
),
expanded=bool(
int(todo.icalendar_component.get("x-errands-expanded", 0))
),
notes=str(todo.icalendar_component.get("description", "")),
parent=str(todo.icalendar_component.get("related-to", "")),
percent_complete=int(
todo.icalendar_component.get("percent-complete", 0)
),
priority=int(todo.icalendar_component.get("priority", 0)),
text=str(todo.icalendar_component.get("summary", "")),
toolbar_shown=bool(
int(todo.icalendar_component.get("x-errands-toolbar-shown", 0))
),
uid=str(todo.icalendar_component.get("uid", "")),
list_uid=calendar.id,
)
Expand Down Expand Up @@ -441,6 +447,8 @@ def __update_remote_task(self, calendar: Calendar, task: TaskData) -> None:
)
todo.icalendar_component["related-to"] = task.parent
todo.icalendar_component["x-errands-color"] = task.color
todo.icalendar_component["x-errands-toolbar-shown"] = task.toolbar_shown
todo.icalendar_component["x-errands-expanded"] = task.expanded
todo.complete() if task.completed else todo.uncomplete()
todo.save()
UserData.update_props(calendar.id, task.uid, ["synced"], [True])
Expand Down Expand Up @@ -470,6 +478,8 @@ def __create_remote_task(self, calendar: Calendar, task: TaskData) -> None:
summary=task.text,
uid=task.uid,
x_errands_color=task.color,
x_errands_expanded=task.expanded,
x_errands_toolbar_shown=task.toolbar_shown,
)
if task.completed:
new_todo.complete()
Expand Down
59 changes: 0 additions & 59 deletions errands/lib/sync/providers/todoist.py

This file was deleted.

0 comments on commit ad42252

Please sign in to comment.