From 90273e96d023ea4b0761cf001af26e7f7a4ef6ca Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Mon, 15 Apr 2024 18:40:04 +0800 Subject: [PATCH] Fix duplicate categories --- gitea-to-ics.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gitea-to-ics.py b/gitea-to-ics.py index 3046826..d2e1e86 100644 --- a/gitea-to-ics.py +++ b/gitea-to-ics.py @@ -29,11 +29,11 @@ def get_combined(token): issues = json.load(response) for issue in issues: _id = issue['id'] - if _id in combined: - combined[_id]['categories'].append(q) - else: + if _id not in combined: combined[_id] = issue - combined[_id]['categories'] = [q] + combined[_id]['categories'] = [] + if q not in combined[_id]['categories']: + combined[_id]['categories'].append(q) timestamp=datetime.datetime.now() print(f"{timestamp} Done processing {q}") return combined