aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-03-16 20:54:00 +0100
committerlonkaars <loek@pipeframe.xyz>2022-03-16 20:54:00 +0100
commit621a1e995f5bc6fb09e3fd3daa3d7608d91777f1 (patch)
treec04c9f0c8e69578e09f67cbd3bcda69edfa28991
parent4754ad83ee95dcae6b34b9ea20b6308fadaa9aa0 (diff)
fix duplicate decsync entries
-rwxr-xr-xmain.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/main.py b/main.py
index cd4daea..fa1805b 100755
--- a/main.py
+++ b/main.py
@@ -48,17 +48,16 @@ def create_task_ical(event):
if not desctext: return None
description, uid = description_parser(desctext)
todo.add("description", description)
- todo.add("uid", description)
+ todo.add("uid", uid)
cal.add_component(todo)
- return cal.to_ical()
+ return (cal.to_ical(), uid)
def task_handler(config, ds, event):
- epoch = time.time()
- timestamp = f"{int(epoch)}{int((epoch % 1) * 10 ** 9)}"
- ical = create_task_ical(event)
- if not ical: return
- ds.set_entry(["resources", timestamp], str(event.decoded('uid'), 'utf-8'), str(ical, 'utf-8'))
+ temp = create_task_ical(event)
+ if not temp: return
+ ical, uid = temp
+ ds.set_entry(["resources", uid], str(event.decoded('uid'), 'utf-8'), str(ical, 'utf-8'))
def main():
config = load_config()