Fix short_description being cut when not needed

This commit is contained in:
rubenwardy 2024-07-27 22:10:04 +01:00
parent 031c3c4684
commit e5de270e65

@ -235,9 +235,12 @@ class PackageTreeNode:
# Calculate short description
if "description" in result:
desc = result["description"]
if len(desc) > 200:
idx = desc.find(".") + 1
cutIdx = min(len(desc), 200 if idx < 5 else idx)
result["short_description"] = desc[:cutIdx]
idx = min(len(desc), 200 if idx < 5 else idx)
result["short_description"] = desc[:idx]
else:
result["short_description"] = desc
if "name" in result:
self.name = result["name"]