Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search event with summary #434

Open
paramazo opened this issue Sep 16, 2024 · 4 comments
Open

Search event with summary #434

paramazo opened this issue Sep 16, 2024 · 4 comments
Milestone

Comments

@paramazo
Copy link

paramazo commented Sep 16, 2024

As described in this commit, i try to search for event with a specific summary. This seems not to work as expected, the attribute gets ignored and all events are fetched.

            events_fetched = calendar.search(
                start=dtstart,
                end=dtend,
                summary="my event 1",
                event=True,
                expand=True)

As a workaround i use search and then i have to use a for loop to check if the summary was found.

            events_fetched = calendar.search(
                start=dtstart,
                end=dtend,
                event=True,
                expand=True)

            split_event = False
            for event in events_fetched:
                summary = event.icalendar_component.get("summary")
                if "my event 1" in summary:
                    split_event = True
@tobixen
Copy link
Member

tobixen commented Sep 16, 2024

It's a server compatibility problem, but I think the workaround should be cheap and harmless and can be added to the CalDAV-library (for all servers ... I do have a long term plan to address server compatibility issues by giving a hint on what kind of server one connects to when creating the client object, then such workarounds would be triggered only on the servers that needs it). Would you care to create a merge request?

@paramazo
Copy link
Author

Sorry, i dont know how to implement it into the CalDAV-library. For me its fine to use the workaround in my script. Maybe you can find a more elegant solution to support summary filtering on search function.

@tobixen
Copy link
Member

tobixen commented Sep 16, 2024

Ok, I will make a fix for this ... at some point in the future, I'm currently a bit overloaded. Should probably make a generic fix for all the text attributes and not only the summary. And it's needed with test code as well.

@tobixen tobixen added this to the v1.5.0 milestone Oct 27, 2024
@tobixen
Copy link
Member

tobixen commented Oct 27, 2024

I will make a proper and general workaround, and do client-side filtering together with #402

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants