BURs: fix normalization of uppercase characters in scripts.

Only downcase tags in aliases, implications, and category change
commands. Don't downcase mass update commands. Mass updates are
potentially case sensitive (for example: `mass update source:imageboard -> source:Imageboard`).
This commit is contained in:
evazion
2020-08-24 17:54:53 -05:00
parent 1ddcc661e1
commit d9085877be
3 changed files with 25 additions and 14 deletions

View File

@@ -19,17 +19,17 @@ class BulkUpdateRequestProcessor
case line
when /\A(?:create alias|aliasing|alias) (\S+) -> (\S+)\z/i
[:create_alias, $1, $2]
[:create_alias, Tag.normalize_name($1), Tag.normalize_name($2)]
when /\A(?:create implication|implicating|implicate|imply) (\S+) -> (\S+)\z/i
[:create_implication, $1, $2]
[:create_implication, Tag.normalize_name($1), Tag.normalize_name($2)]
when /\A(?:remove alias|unaliasing|unalias) (\S+) -> (\S+)\z/i
[:remove_alias, $1, $2]
[:remove_alias, Tag.normalize_name($1), Tag.normalize_name($2)]
when /\A(?:remove implication|unimplicating|unimplicate|unimply) (\S+) -> (\S+)\z/i
[:remove_implication, $1, $2]
[:remove_implication, Tag.normalize_name($1), Tag.normalize_name($2)]
when /\A(?:mass update|updating|update|change) (.+?) -> (.*)\z/i
[:mass_update, $1, $2]
when /\Acategory (\S+) -> (#{Tag.categories.regexp})\z/i
[:change_category, $1, $2]
[:change_category, Tag.normalize_name($1), $2.downcase]
else
[:invalid_line, line]
end