[User] Don't count replacement backups against upload limit

This commit is contained in:
Earlopain 2023-10-15 14:16:23 +02:00
parent cc6e18797a
commit 0d94e076a1
No known key found for this signature in database
GPG Key ID: 48860312319ADF61

View File

@ -555,7 +555,7 @@ class User < ApplicationRecord
def hourly_upload_limit
post_count = posts.where("created_at >= ?", 1.hour.ago).count
replacement_count = can_approve_posts? ? 0 : post_replacements.where("created_at >= ?", 1.hour.ago).count
replacement_count = can_approve_posts? ? 0 : post_replacements.where("created_at >= ? and status != ?", 1.hour.ago, "original").count
Danbooru.config.hourly_upload_limit - post_count - replacement_count
end
memoize :hourly_upload_limit