From f8d6da059332be0c8aa5a2f85602c83d1d9434e7 Mon Sep 17 00:00:00 2001 From: Antonio Vivace Date: Thu, 6 Jun 2024 20:46:34 +0200 Subject: [PATCH] sync-db: manually set entries as OSS if they have a license or a repository --- scripts/sync_db.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/sync_db.py b/scripts/sync_db.py index 2318885..afe8ab9 100644 --- a/scripts/sync_db.py +++ b/scripts/sync_db.py @@ -127,6 +127,15 @@ def run(): except Exception: parsed_date = None + # Manually flag an entry as Open Source if it has an explicit license + # set or if it has a valid git repository + if "Open Source" not in data["tags"]: + if "repository" in data: + if data["repository"] != "": + data["tags"].append("Open Source") + if "gameLicense" in data: + data["tags"].append("Open Source") + # Returns an (entry, bool) tuple. Here we don't need the object that was # either updated or created, we only want to know if it was created or not _, created = Entry.objects.update_or_create(