このコミットが含まれているのは:
2026-05-23 03:50:54 +09:00
コミット 7fcfc8b8aa
10個のファイルの変更55行の追加23行の削除
+7 -2
ファイルの表示
@@ -102,7 +102,7 @@ class Tag < ApplicationRecord
tags = tag_names.map do |name|
pf, cat = CATEGORY_PREFIXES.find { |p, _| name.downcase.start_with?(p) } || ['', nil]
name = TagName.canonicalise(name.sub(/\A#{ pf }/i, '')).first
name = name.sub(/\A#{ pf }/i, '')
sections_by_tag = []
while n = name.sub!(/^(\S*?)\[([0-9:.]*?)-([0-9:.]*?)\](\S*?)$/, '\1\4 \2 \3')
@@ -116,9 +116,14 @@ class Tag < ApplicationRecord
sections_by_tag << [begin_ms, end_ms]
end
name = TagName.canonicalise(name).first
find_or_create_by_tag_name!(name, category: (cat || :general)).tap do |tag|
tag.update!(category: cat) if cat && tag.category != cat
sections[tag.id] = sections_by_tag if sections_by_tag.present?
next if sections_by_tag.blank?
sections[tag.id] ||= []
sections[tag.id].concat(sections_by_tag)
end
end