larkery / orgcal

Android calendar <-> org mode
14 stars 0 forks source link

Feature request: add read-only mode #4

Open novoid opened 2 years ago

novoid commented 2 years ago

Hi,

I do have large Orgdown files I only want to visualize on my Android calendar by using orgcal. I don't want to modify them by accident for many reasons - most prominent to avoid tedious (and potentially unrecognized) sync conflicts.

Therefore, it would be peachy to have an option to use the Orgdown files in a read-only fashion without writing any changes from my Android calendar back to the Orgdown files.

larkery commented 2 years ago

This is only possible if you set the ID property yourself on all the headings you want to sync. There's no other stable way to relate a heading to an event. At the moment orgcal will add the ID property to any heading it wants to put in the calendar (unless it's already there).

novoid commented 2 years ago

I see. I've checked and saw the UUIDs added by orgcal to the Orgdown files.

I understand why those are necessary. However, for a read-only mode, my gut feelings do tell me that there is no need for an ID as long as I don't modify the events in the Android calendar. I don't know if there is an option to create a read-only calendar provider for Android. In worst case, orgcal would need to re-generate all events on each scan I guess.

But yes, this is probably not a small change to implement, I guess.

larkery commented 2 years ago

Oh yeah, you could wipe the calendar every time rather than updating it, I didn't consider that. I'm not sure how well the android calendar system would take to this, the design is very focused on updating things after changes, but it is an option. I'll think about it.

larkery commented 2 years ago

I hacked something in for this. I don't understand why, but I haven't been able to get android to present the calendar as readonly, even though I am doing the thing the API docs say should make it readonly.

However there is a guard around writing any changes back to the org files so if you modify an event the files won't get touched, it'll just end up out of sync in some way.