Skip to content

Commit

Permalink
Refactor logs
Browse files Browse the repository at this point in the history
  • Loading branch information
mrvladus committed Oct 12, 2023
1 parent 1a085b9 commit da3678c
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,15 @@ def _fetch(self):
if task["id"] in caldav_ids and task["synced_caldav"]:
for caldav_task in caldav_tasks:
if caldav_task["id"] == task["id"]:
Log.debug(f"Update local task from {self.name}: {task['id']}")
task["text"] = caldav_task["text"]
task["parent"] = caldav_task["parent"]
task["completed"] = caldav_task["completed"]
task["color"] = caldav_task["color"]
updated: bool = False
for key in ["text", "parent", "completed", "color"]:
if task[key] != caldav_task[key]:
task[key] = caldav_task[key]
updated = True
if updated:
Log.debug(
f"Update local task from {self.name}: {task['id']}"
)
break
# Delete local task that was deleted on CalDAV
if task["id"] not in caldav_ids and task["synced_caldav"]:
Expand Down

0 comments on commit da3678c

Please sign in to comment.