logic fixes

master
Aevann 2024-10-23 23:34:40 +03:00
parent 780e53d119
commit 3cbfc5d697
1 changed files with 6 additions and 4 deletions

View File

@ -438,14 +438,16 @@ def _cleanup_videos():
shadowbanned_media_usages_posts = db.query(MediaUsage).join(MediaUsage.post).join(Post.author).filter(
MediaUsage.post_id != None,
User.shadowbanned != None,
MediaUsage.created_utc < 9999999999,
).all()
MediaUsage.created_utc < one_month_ago,
MediaUsage.removed_utc == None,
).order_by(Post.id).all()
shadowbanned_media_usages_comments = db.query(MediaUsage).join(MediaUsage.comment).join(Comment.author).filter(
MediaUsage.comment_id != None,
User.shadowbanned != None,
MediaUsage.created_utc < 9999999999,
).all()
MediaUsage.created_utc < one_month_ago,
MediaUsage.removed_utc == None,
).order_by(Comment.id).all()
shadowbanned_media_usages = shadowbanned_media_usages_posts + shadowbanned_media_usages_comments