reduce tag sub post limit
This commit is contained in:
@@ -43,8 +43,9 @@ class TagSubscription < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def process
|
||||
divisor = [tag_query_array.size / 2, 1].max
|
||||
post_ids = tag_query_array.inject([]) do |all, tag|
|
||||
all += Post.tag_match(tag).limit(Danbooru.config.tag_subscription_post_limit / 3).select("posts.id").order("posts.id DESC").map(&:id)
|
||||
all += Post.tag_match(tag).limit(Danbooru.config.tag_subscription_post_limit / divisor).select("posts.id").order("posts.id DESC").map(&:id)
|
||||
end
|
||||
self.post_ids = post_ids.sort.reverse.slice(0, Danbooru.config.tag_subscription_post_limit).join(",")
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user