forked from rDrama/rDrama
1
0
Fork 0

capitalize

master
Aevann 2024-01-23 14:56:46 +02:00
parent 4fd3f11797
commit 01feb558e8
1 changed files with 28 additions and 28 deletions

View File

@ -90,34 +90,34 @@ def stats():
week = int(now) - 604800 week = int(now) - 604800
stats = { stats = {
"time": int(time.time()), "Time these stats were collected": int(time.time()),
"marseys": "{:,}".format(g.db.query(Emoji).filter(Emoji.kind=="Marsey", Emoji.submitter_id==None).count()), "Marseys": "{:,}".format(g.db.query(Emoji).filter(Emoji.kind=="Marsey", Emoji.submitter_id==None).count()),
"total emojis": "{:,}".format(g.db.query(Emoji).filter(Emoji.submitter_id==None).count()), "Total emojis": "{:,}".format(g.db.query(Emoji).filter(Emoji.submitter_id==None).count()),
"users": "{:,}".format(g.db.query(User).count()), "Users": "{:,}".format(g.db.query(User).count()),
"private users": "{:,}".format(g.db.query(User).filter_by(is_private=True).count()), "Private users": "{:,}".format(g.db.query(User).filter_by(is_private=True).count()),
"banned users": "{:,}".format(g.db.query(User).filter(User.is_banned != None).count()), "Banned users": "{:,}".format(g.db.query(User).filter(User.is_banned != None).count()),
"verified email users": "{:,}".format(g.db.query(User).filter_by(email_verified=True).count()), "Verified email users": "{:,}".format(g.db.query(User).filter_by(email_verified=True).count()),
"coins in circulation": "{:,}".format(g.db.query(func.sum(User.coins)).scalar()), "Coins in circulation": "{:,}".format(g.db.query(func.sum(User.coins)).scalar()),
"total shop sales": "{:,}".format(g.db.query(func.sum(User.coins_spent)).scalar()), "Total shop sales": "{:,}".format(g.db.query(func.sum(User.coins_spent)).scalar()),
"signups last 24h": "{:,}".format(g.db.query(User).filter(User.created_utc > day).count()), "Signups last 24h": "{:,}".format(g.db.query(User).filter(User.created_utc > day).count()),
"total posts": "{:,}".format(g.db.query(Post).count()), "Total posts": "{:,}".format(g.db.query(Post).count()),
"posting users": "{:,}".format(g.db.query(Post.author_id).distinct().count()), "Posting users": "{:,}".format(g.db.query(Post.author_id).distinct().count()),
"listed posts": "{:,}".format(g.db.query(Post).filter_by(is_banned=False).filter(Post.deleted_utc == 0).count()), "Listed posts": "{:,}".format(g.db.query(Post).filter_by(is_banned=False).filter(Post.deleted_utc == 0).count()),
"removed posts (by admins)": "{:,}".format(g.db.query(Post).filter_by(is_banned=True).count()), "Removed posts (by admins)": "{:,}".format(g.db.query(Post).filter_by(is_banned=True).count()),
"deleted posts (by author)": "{:,}".format(g.db.query(Post).filter(Post.deleted_utc > 0).count()), "Deleted posts (by author)": "{:,}".format(g.db.query(Post).filter(Post.deleted_utc > 0).count()),
"posts last 24h": "{:,}".format(g.db.query(Post).filter(Post.created_utc > day).count()), "Posts last 24h": "{:,}".format(g.db.query(Post).filter(Post.created_utc > day).count()),
"total comments": "{:,}".format(g.db.query(Comment).filter(Comment.author_id != AUTOJANNY_ID).count()), "Total comments": "{:,}".format(g.db.query(Comment).filter(Comment.author_id != AUTOJANNY_ID).count()),
"commenting users": "{:,}".format(g.db.query(Comment.author_id).distinct().count()), "Commenting users": "{:,}".format(g.db.query(Comment.author_id).distinct().count()),
"removed comments (by admins)": "{:,}".format(g.db.query(Comment).filter_by(is_banned=True).count()), "Removed comments (by admins)": "{:,}".format(g.db.query(Comment).filter_by(is_banned=True).count()),
"deleted comments (by author)": "{:,}".format(g.db.query(Comment).filter(Comment.deleted_utc > 0).count()), "Deleted comments (by author)": "{:,}".format(g.db.query(Comment).filter(Comment.deleted_utc > 0).count()),
"comments last 24h": "{:,}".format(g.db.query(Comment).filter(Comment.created_utc > day, Comment.author_id != AUTOJANNY_ID).count()), "Comments last 24h": "{:,}".format(g.db.query(Comment).filter(Comment.created_utc > day, Comment.author_id != AUTOJANNY_ID).count()),
"post votes": "{:,}".format(g.db.query(Vote).count()), "Post votes": "{:,}".format(g.db.query(Vote).count()),
"comment votes": "{:,}".format(g.db.query(CommentVote).count()), "Comment votes": "{:,}".format(g.db.query(CommentVote).count()),
"total upvotes": "{:,}".format(g.db.query(Vote).filter_by(vote_type=1).count() + g.db.query(CommentVote).filter_by(vote_type=1).count()), "Total upvotes": "{:,}".format(g.db.query(Vote).filter_by(vote_type=1).count() + g.db.query(CommentVote).filter_by(vote_type=1).count()),
"total downvotes": "{:,}".format(g.db.query(Vote).filter_by(vote_type=-1).count() + g.db.query(CommentVote).filter_by(vote_type=-1).count()), "Total downvotes": "{:,}".format(g.db.query(Vote).filter_by(vote_type=-1).count() + g.db.query(CommentVote).filter_by(vote_type=-1).count()),
"total awards": "{:,}".format(g.db.query(AwardRelationship).count()), "Total awards": "{:,}".format(g.db.query(AwardRelationship).count()),
"awards given": "{:,}".format(g.db.query(AwardRelationship).filter(or_(AwardRelationship.post_id != None, AwardRelationship.comment_id != None)).count()), "Awards given": "{:,}".format(g.db.query(AwardRelationship).filter(or_(AwardRelationship.post_id != None, AwardRelationship.comment_id != None)).count()),
"users who posted, commented, or voted in the past 7 days": "{:,}".format(g.db.query(User).filter(User.last_active > week).count()), "Users who posted, commented, or voted in the past 7 days": "{:,}".format(g.db.query(User).filter(User.last_active > week).count()),
} }
if FEATURES['HOUSES']: if FEATURES['HOUSES']: