Skip to content

Commit

Permalink
Scripts: Delete tags that have a usage_count of 0
Browse files Browse the repository at this point in the history
  • Loading branch information
andygrunwald committed Jun 11, 2024
1 parent 888e183 commit 7b43119
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/find_tags_that_need_descriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,16 @@ def get_all_tags_without_description(tag_descriptions, tags):

# Updating the local JSON tag file:
# - updating the usage count
for t in tag_descriptions:
for t in list(tag_descriptions):
usage_count = 0
if t in tags:
usage_count = tags[t]

# Delete tags that don't have any content
if usage_count == 0:
del tag_descriptions[t]
continue

tag_descriptions[t]["usage_count"] = usage_count

# Finally write the file
Expand Down

0 comments on commit 7b43119

Please sign in to comment.