From 54cdfb81e4838593b4868cd4a3e3b7aeb67af6f9 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Sun, 4 Jan 2026 14:44:40 -0800 Subject: [PATCH 1/2] return extra field in weapon responses (#203) was being saved but not returned, so frontend always saw it as undefined --- app/blueprints/api/v1/weapon_blueprint.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/blueprints/api/v1/weapon_blueprint.rb b/app/blueprints/api/v1/weapon_blueprint.rb index 4c12cf3..681ff13 100644 --- a/app/blueprints/api/v1/weapon_blueprint.rb +++ b/app/blueprints/api/v1/weapon_blueprint.rb @@ -13,7 +13,7 @@ module Api # Primary information fields :granblue_id, :element, :proficiency, :max_level, :max_skill_level, :max_awakening_level, :limit, :rarity, - :ax, :ax_type, :gacha, :promotions, :forge_order + :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| From f0b2d1fff758457917aa768f98ea91aa1a9e3e19 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Sun, 4 Jan 2026 14:44:52 -0800 Subject: [PATCH 2/2] rename suggestions to parsed_data in batch preview (#204) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - rename SuggestionParser → WikiDataParser - change response key from suggestions → parsed_data --- app/controllers/concerns/batch_previewable.rb | 20 +++++++++---------- ...ggestion_parser.rb => wiki_data_parser.rb} | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) rename lib/granblue/parsers/{suggestion_parser.rb => wiki_data_parser.rb} (99%) diff --git a/app/controllers/concerns/batch_previewable.rb b/app/controllers/concerns/batch_previewable.rb index a1671ee..bfd4b75 100644 --- a/app/controllers/concerns/batch_previewable.rb +++ b/app/controllers/concerns/batch_previewable.rb @@ -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 diff --git a/lib/granblue/parsers/suggestion_parser.rb b/lib/granblue/parsers/wiki_data_parser.rb similarity index 99% rename from lib/granblue/parsers/suggestion_parser.rb rename to lib/granblue/parsers/wiki_data_parser.rb index fc3b928..ce444d3 100644 --- a/lib/granblue/parsers/suggestion_parser.rb +++ b/lib/granblue/parsers/wiki_data_parser.rb @@ -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?