소스 검색

Improve Emoji import (fix #15429) (#15430)

* Improve Emoji import

Skip macOS '._' shadow files in tar archive to speed up import

* Fix codeclimate format issue with whitespace

* Update lib/mastodon/emoji_cli.rb

suggestions from Gargron to improve comment

Co-authored-by: Eugen Rochko <eugen@zeonfederated.com>

* Update emoji_cli.rb

Remove extraneous comment (macOS-specific comment now with correct line)

Co-authored-by: Eugen Rochko <eugen@zeonfederated.com>
pull/15476/head
Sophie Parker 3 달 전
committed by GitHub
부모
커밋
c7262d12b2
No known key found for this signature in database GPG 키 ID: 4AEE18F83AFDEB23
1개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. +6
    -1
      lib/mastodon/emoji_cli.rb

+ 6
- 1
lib/mastodon/emoji_cli.rb 파일 보기

@@ -43,7 +43,12 @@ module Mastodon
tar.each do |entry|
next unless entry.file? && entry.full_name.end_with?('.png')

shortcode = [options[:prefix], File.basename(entry.full_name, '.*'), options[:suffix]].compact.join
filename = File.basename(entry.full_name, '.*')

# Skip macOS shadow files
next if filename.start_with?('._')

shortcode = [options[:prefix], filename, options[:suffix]].compact.join
custom_emoji = CustomEmoji.local.find_by(shortcode: shortcode)

if custom_emoji && !options[:overwrite]


불러오는 중...
취소
저장