From 9008e836e45723b5a661e3e99908ae91d9e63c69 Mon Sep 17 00:00:00 2001 From: evazion Date: Mon, 4 Jan 2021 01:09:06 -0600 Subject: [PATCH] BURs: raise limit on Builder artist tag moves from 100 to 200 posts. --- app/logical/bulk_update_request_processor.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/logical/bulk_update_request_processor.rb b/app/logical/bulk_update_request_processor.rb index a6e257a66..ea77175fb 100644 --- a/app/logical/bulk_update_request_processor.rb +++ b/app/logical/bulk_update_request_processor.rb @@ -1,5 +1,11 @@ class BulkUpdateRequestProcessor + # Maximum tag size allowed by the rename command before an alias must be used. MAXIMUM_RENAME_COUNT = 200 + + # Maximum size of artist tags movable by builders. + MAXIMUM_BUILDER_MOVE_COUNT = 200 + + # Maximum number of lines a BUR may have. MAXIMUM_SCRIPT_LENGTH = 100 include ActiveModel::Validations @@ -216,13 +222,13 @@ class BulkUpdateRequestProcessor # # * The antecedent tag is an artist tag. # * The consequent_tag is a nonexistent tag, an empty tag (of any type), or an artist tag. - # * Both tags have less than 100 posts. + # * Both tags have less than 200 posts. def self.is_tag_move_allowed?(antecedent_name, consequent_name) antecedent_tag = Tag.find_by_name(Tag.normalize_name(antecedent_name)) consequent_tag = Tag.find_by_name(Tag.normalize_name(consequent_name)) - antecedent_allowed = antecedent_tag.present? && antecedent_tag.artist? && antecedent_tag.post_count < 100 - consequent_allowed = consequent_tag.nil? || consequent_tag.empty? || (consequent_tag.artist? && consequent_tag.post_count < 100) + antecedent_allowed = antecedent_tag.present? && antecedent_tag.artist? && antecedent_tag.post_count < MAXIMUM_BUILDER_MOVE_COUNT + consequent_allowed = consequent_tag.nil? || consequent_tag.empty? || (consequent_tag.artist? && consequent_tag.post_count < MAXIMUM_BUILDER_MOVE_COUNT) antecedent_allowed && consequent_allowed end