Skip to content

Commit 4ea5e07

Browse files
feat: simplify defaultSortWeight influence by stars
1 parent 99c900f commit 4ea5e07

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

scripts/check_modules.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -497,16 +497,11 @@ def check_modules():
497497
module["issues"] = False
498498

499499
# Lift modules with many stars in the default sort order.
500-
if module.get('stars', 0) > 50:
501-
module["defaultSortWeight"] = module["defaultSortWeight"] - \
502-
(module['stars'] // 50)
503-
elif module.get('stars', 0) > 10:
504-
module["defaultSortWeight"] = module["defaultSortWeight"] - 1
500+
module["defaultSortWeight"] = module["defaultSortWeight"] - (module['stars'] // 20)
505501

506502
# Modules with few stars shouldn't be too far up in the default sort order. So we give them a minimum value of one.
507-
elif module.get('stars', 0) < 3:
508-
module["defaultSortWeight"] = max(
509-
module["defaultSortWeight"], 1)
503+
if module.get('stars', 0) < 3:
504+
module["defaultSortWeight"] = max(module["defaultSortWeight"], 1)
510505

511506
# Just to reduce imbalance in the default sort order, modules from this developer get a minimum value of one.
512507
if module['maintainer'] == "KristjanESPERANTO" and module["name"] != "MMM-EasyPix":

0 commit comments

Comments
 (0)