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

Update existing events instead of replacing them #14

Open
luhuhis opened this issue May 24, 2022 · 3 comments
Open

Update existing events instead of replacing them #14

luhuhis opened this issue May 24, 2022 · 3 comments

Comments

@luhuhis
Copy link

luhuhis commented May 24, 2022

Hi,
is it possible to add functionality such that events are updated when they've changed, instead of always deleting/creating all?
The problem with the latter is that if you merge into a calendar that is subscribed to by other people (who may have email notifications turned on), then that can easily lead to your gmail account sending out hundreds of emails, which you have no control over.

The events should by identifiable by their respective event ids, should they not?

Of course you would need to loop over all events in the specified time frame of the calendar you want to merge into.

@luhuhis
Copy link
Author

luhuhis commented May 27, 2022

For each source event one can just copy the iCalUID as well. By checking for this ID and the special character one can ensure that events are uniquely matched into source-target pairs.

@dominikbullo
Copy link

+1

@hamon-e
Copy link

hamon-e commented Feb 27, 2024

Because I spend way to much time updating this, here is my version of it

https://gist.github.com/hamon-e/d5a653a5ae7865e45ca90cb81252ec1b

solve a few problems with iCalUID (recurring events have the same iCalUID but different ids (id = iCalUID + "_" + date + "z"), BUT when we are the ones creating an event id can't contains _ or z)
https://gist.github.com/hamon-e/d5a653a5ae7865e45ca90cb81252ec1b#file-gistfile1-gs-L193

do not update events if not needed

add all the events, remove the if true if not wanted
https://gist.github.com/hamon-e/d5a653a5ae7865e45ca90cb81252ec1b#file-gistfile1-gs-L145

added a color system to recognized the source of the events
https://gist.github.com/hamon-e/d5a653a5ae7865e45ca90cb81252ec1b#file-gistfile1-gs-L8

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

No branches or pull requests

3 participants