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
stats = {
"time": int(time.time()),
"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()),
"users": "{:,}".format(g.db.query(User).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()),
"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()),
"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()),
"total posts": "{:,}".format(g.db.query(Post).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()),
"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()),
"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()),
"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()),
"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()),
"post votes": "{:,}".format(g.db.query(Vote).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 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()),
"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()),
"Time these stats were collected": int(time.time()),
"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()),
"Users": "{:,}".format(g.db.query(User).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()),
"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()),
"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()),
"Total posts": "{:,}".format(g.db.query(Post).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()),
"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()),
"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()),
"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()),
"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()),
"Post votes": "{:,}".format(g.db.query(Vote).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 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()),
"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()),
}
if FEATURES['HOUSES']: