diff options
author | lonkaars <loek@pipeframe.xyz> | 2022-03-16 20:54:00 +0100 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2022-03-16 20:54:00 +0100 |
commit | 621a1e995f5bc6fb09e3fd3daa3d7608d91777f1 (patch) | |
tree | c04c9f0c8e69578e09f67cbd3bcda69edfa28991 | |
parent | 4754ad83ee95dcae6b34b9ea20b6308fadaa9aa0 (diff) |
fix duplicate decsync entries
-rwxr-xr-x | main.py | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -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() |