]> cat aescling's git repositories - mastodon.git/commitdiff
tootctl emoji import: case insensitive duplicate check (#15738)
authorStanislas <stanislas.lange@pm.me>
Wed, 24 Mar 2021 09:55:16 +0000 (10:55 +0100)
committerGitHub <noreply@github.com>
Wed, 24 Mar 2021 09:55:16 +0000 (10:55 +0100)
lib/mastodon/emoji_cli.rb

index 0a1f538e6fc27a920712f02bb4cb5671fc87512b..5bee70ea51e52bfc0ad8418133deb85ef65af54d 100644 (file)
@@ -49,7 +49,7 @@ module Mastodon
           next if filename.start_with?('._')
 
           shortcode    = [options[:prefix], filename, options[:suffix]].compact.join
-          custom_emoji = CustomEmoji.local.find_by(shortcode: shortcode)
+          custom_emoji = CustomEmoji.local.find_by("LOWER(shortcode) = ?", shortcode.downcase)
 
           if custom_emoji && !options[:overwrite]
             skipped += 1