fix(stats): refine logic to count only downloadable post types in statistics
This commit is contained in:
@@ -639,8 +639,8 @@ class OpenWebUIStats:
|
|||||||
stats["total_saves"] += post.get("saveCount", 0)
|
stats["total_saves"] += post.get("saveCount", 0)
|
||||||
stats["total_comments"] += post.get("commentCount", 0)
|
stats["total_comments"] += post.get("commentCount", 0)
|
||||||
|
|
||||||
# Key: only count downloadable types in by_type (exclude post, review)
|
# Key: only count downloadable types (exclude post, review)
|
||||||
if post_type in self.DOWNLOADABLE_TYPES or post_downloads > 0:
|
if post_type in self.DOWNLOADABLE_TYPES:
|
||||||
stats["total_views"] += post_views
|
stats["total_views"] += post_views
|
||||||
if post_type not in stats["by_type"]:
|
if post_type not in stats["by_type"]:
|
||||||
stats["by_type"][post_type] = 0
|
stats["by_type"][post_type] = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user