1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-10-12 21:41:56 +00:00

Add basic free-busy report

This commit is contained in:
Ray 2023-10-06 13:15:45 -06:00
parent 6b34323c1e
commit 7b0d88ff0d
5 changed files with 156 additions and 43 deletions

View file

@ -158,6 +158,24 @@ class BaseCollection:
continue
yield item, simple and (start <= istart or iend <= end)
def get_by_time(self, start: int , end: int
) -> Iterable["radicale_item.Item"]:
"""Fetch all items within a start and end time range.
Returns a iterable of ``item``s.
"""
if not self.tag:
return
for item in self.get_all():
# TODO: Any other component_name here?
if item.component_name not in ("VEVENT",):
continue
istart, iend = item.time_range
if istart >= end or iend <= start:
continue
yield item
def has_uid(self, uid: str) -> bool:
"""Check if a UID exists in the collection."""
for item in self.get_all():