fix(caldav): Fix caldav search() due to missing todos
This commit is contained in:
@@ -260,7 +260,7 @@ class CalendarClient:
|
||||
|
||||
result = []
|
||||
for event in events:
|
||||
await event.load()
|
||||
await event.load(only_if_unloaded=True)
|
||||
event_dict = self._parse_ical_event(event.data)
|
||||
if event_dict:
|
||||
event_dict["href"] = str(event.url)
|
||||
@@ -311,7 +311,7 @@ class CalendarClient:
|
||||
|
||||
# Find the event by UID using caldav library
|
||||
event = await calendar.event_by_uid(event_uid)
|
||||
await event.load()
|
||||
await event.load(only_if_unloaded=True)
|
||||
|
||||
# Merge updates into existing iCal data
|
||||
updated_ical = self._merge_ical_properties(event.data, event_data, event_uid)
|
||||
@@ -347,7 +347,7 @@ class CalendarClient:
|
||||
calendar = self._get_calendar(calendar_name)
|
||||
|
||||
event = await calendar.event_by_uid(event_uid)
|
||||
await event.load()
|
||||
await event.load(only_if_unloaded=True)
|
||||
|
||||
event_data = self._parse_ical_event(event.data)
|
||||
if not event_data:
|
||||
@@ -413,7 +413,9 @@ class CalendarClient:
|
||||
|
||||
result = []
|
||||
for todo in todos:
|
||||
await todo.load()
|
||||
# Only load if data not already present from REPORT response
|
||||
# This avoids 404 errors for virtual calendars (e.g., Deck boards)
|
||||
await todo.load(only_if_unloaded=True)
|
||||
todo_dict = self._parse_ical_todo(todo.data)
|
||||
if todo_dict:
|
||||
todo_dict["href"] = str(todo.url)
|
||||
@@ -465,7 +467,7 @@ class CalendarClient:
|
||||
try:
|
||||
# Find the todo by UID
|
||||
todo = await calendar.todo_by_uid(todo_uid)
|
||||
await todo.load()
|
||||
await todo.load(only_if_unloaded=True)
|
||||
|
||||
logger.debug(
|
||||
f"Loaded todo {todo_uid}, current data length: {len(todo.data)}"
|
||||
|
||||
@@ -54,8 +54,8 @@ wheels = [
|
||||
|
||||
[[package]]
|
||||
name = "caldav"
|
||||
version = "2.0.2.dev37+g543d3829b"
|
||||
source = { git = "https://github.com/cbcoutinho/caldav?branch=feature%2Fhttpx#543d3829b3caedadd9d3d52b91c01fd9f73cce02" }
|
||||
version = "2.0.2.dev38+g1aa2be35e"
|
||||
source = { git = "https://github.com/cbcoutinho/caldav?branch=feature%2Fhttpx#1aa2be35e94883b44efd42f1cd82d281f8f58e60" }
|
||||
dependencies = [
|
||||
{ name = "httpx", extra = ["http2"] },
|
||||
{ name = "icalendar" },
|
||||
|
||||
Reference in New Issue
Block a user