Merge branch 'next-main' into feature/max-exorcism-level
This commit is contained in:
commit
63bef81312
3 changed files with 13 additions and 13 deletions
|
|
@ -13,7 +13,7 @@ module Api
|
|||
# Primary information
|
||||
fields :granblue_id, :element, :proficiency,
|
||||
:max_level, :max_skill_level, :max_awakening_level, :max_exorcism_level,
|
||||
:limit, :rarity, :ax, :ax_type, :gacha, :promotions, :forge_order
|
||||
:limit, :rarity, :ax, :ax_type, :gacha, :promotions, :forge_order, :extra
|
||||
|
||||
# Series - returns full object with flags if weapon_series is present, fallback to legacy integer
|
||||
field :series do |w|
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ module BatchPreviewable
|
|||
# @param wiki_page [String] The wiki page name to fetch
|
||||
# @param entity_type [Symbol] The type of entity (:character, :weapon, :summon)
|
||||
# @param wiki_raw [String, nil] Pre-fetched wiki text (from client-side fetch)
|
||||
# @return [Hash] Preview data including status, suggestions, and errors
|
||||
# @return [Hash] Preview data including status, parsed_data, and errors
|
||||
def process_wiki_preview(wiki_page, entity_type, wiki_raw: nil)
|
||||
result = {
|
||||
wiki_page: wiki_page,
|
||||
|
|
@ -39,22 +39,22 @@ module BatchPreviewable
|
|||
|
||||
result[:wiki_raw] = wiki_text
|
||||
|
||||
# Parse suggestions based on entity type
|
||||
suggestions = case entity_type
|
||||
# Parse data from wiki text based on entity type
|
||||
parsed_data = case entity_type
|
||||
when :character
|
||||
Granblue::Parsers::SuggestionParser.parse_character(wiki_text)
|
||||
Granblue::Parsers::WikiDataParser.parse_character(wiki_text)
|
||||
when :weapon
|
||||
Granblue::Parsers::SuggestionParser.parse_weapon(wiki_text)
|
||||
Granblue::Parsers::WikiDataParser.parse_weapon(wiki_text)
|
||||
when :summon
|
||||
Granblue::Parsers::SuggestionParser.parse_summon(wiki_text)
|
||||
Granblue::Parsers::WikiDataParser.parse_summon(wiki_text)
|
||||
end
|
||||
|
||||
result[:granblue_id] = suggestions[:granblue_id] if suggestions[:granblue_id].present?
|
||||
result[:suggestions] = suggestions
|
||||
result[:granblue_id] = parsed_data[:granblue_id] if parsed_data[:granblue_id].present?
|
||||
result[:parsed_data] = parsed_data
|
||||
|
||||
# Queue image download if we have a granblue_id
|
||||
if suggestions[:granblue_id].present?
|
||||
result[:image_status] = queue_image_download(suggestions[:granblue_id], entity_type)
|
||||
if parsed_data[:granblue_id].present?
|
||||
result[:image_status] = queue_image_download(parsed_data[:granblue_id], entity_type)
|
||||
else
|
||||
result[:image_status] = 'no_id'
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
module Granblue
|
||||
module Parsers
|
||||
# SuggestionParser extracts structured suggestions from wiki text
|
||||
# WikiDataParser extracts structured data from wiki text
|
||||
# for use in batch entity import flows
|
||||
class SuggestionParser
|
||||
class WikiDataParser
|
||||
# Parse character wiki text into suggestion fields
|
||||
def self.parse_character(wiki_text)
|
||||
return {} if wiki_text.blank?
|
||||
Loading…
Reference in a new issue