diff --git a/boards/models/tag.py b/boards/models/tag.py --- a/boards/models/tag.py +++ b/boards/models/tag.py @@ -7,11 +7,9 @@ from django.db.models import Count MAX_TAG_FONT = 1 MIN_TAG_FONT = 0.2 -TAG_POPULARITY_MULTIPLIER = 10 +TAG_POPULARITY_MULTIPLIER = 20 -OPENING_POST_POPULARITY = 0.1 -REPLY_POPULARITY = 0.005 -ARCHIVE_POPULARITY_MODIFIER = 0.1 +ARCHIVE_POPULARITY_MODIFIER = 0.5 class TagManager(models.Manager): @@ -54,7 +52,11 @@ class Tag(models.Model): tag_reply_count = 0.0 for thread in self.threads.all(): - tag_reply_count += thread.get_reply_count() + if thread.archived: + modifier = ARCHIVE_POPULARITY_MODIFIER + else: + modifier = 1 + tag_reply_count += thread.get_reply_count() * modifier popularity = tag_reply_count / all_post_count @@ -84,8 +86,8 @@ class Tag(models.Model): popularity = self.get_popularity() - font_value = popularity * TAG_POPULARITY_MULTIPLIER - font_value = max(font_value, MIN_TAG_FONT) + font_value = popularity * Tag.objects.all().count() + font_value = max(font_value, MIN_TAG_FONT) font_value = min(font_value, MAX_TAG_FONT) return str(font_value)