diff --git a/openfut-core b/openfut-core index 36bc594..c896545 160000 --- a/openfut-core +++ b/openfut-core @@ -1 +1 @@ -Subproject commit 36bc594924aae333bd7956f4b2825b900f424f27 +Subproject commit c896545cf075cafff8d0e9a7a34caefc300a1e98 diff --git a/openfut-import-fifa17/src/lib.rs b/openfut-import-fifa17/src/lib.rs index d674146..4858a50 100644 --- a/openfut-import-fifa17/src/lib.rs +++ b/openfut-import-fifa17/src/lib.rs @@ -1113,6 +1113,9 @@ pub struct EmitSummary { pub content_pack: std::path::PathBuf, pub host_catalog: std::path::PathBuf, pub manifest: std::path::PathBuf, + /// Core `reclassify` request correcting the content_kind of rows imported + /// before the taxonomy existed. + pub reclassify: std::path::PathBuf, pub definitions: usize, pub catalog_entries: usize, pub supported_instances: usize, @@ -1242,6 +1245,27 @@ pub fn emit_content( let host_catalog = content_dir.join("fifa17-production-catalog.json"); write_json_pretty(&host_catalog, &catalog)?; + // ---- Core reclassify request (content_kind of already-imported rows) ---- + // A profile import is once-only, so a club imported before the taxonomy + // existed still records its coaches, kits and consumables as players. Core + // cannot derive the right kind (it is FIFA17 taxonomy), so hand it the + // mapping. Players are included too: a definition that was mis-set stays + // correctable, and a rerun changes nothing. + let assignments: Vec = report + .definitions + .supported + .iter() + .map(|d| serde_json::json!({ "card_id": d.card_id, "content_kind": "player" })) + .chain(report.non_player.supported.iter().map(|d| { + serde_json::json!({ "card_id": d.card_id, "content_kind": d.kind.as_str() }) + })) + .collect(); + let reclassify = content_dir.join("fifa17-reclassify.json"); + write_json_pretty( + &reclassify, + &serde_json::json!({ "game_id": "fifa17", "assignments": assignments }), + )?; + // ---- PRIVATE: import manifest (wire ids + deferred set) ---- let supported: Vec = report .definitions @@ -1351,6 +1375,7 @@ pub fn emit_content( Ok(EmitSummary { content_pack, host_catalog, + reclassify, manifest: manifest_path, definitions: report.definitions.supported.len(), catalog_entries: report.definitions.supported.len() + non_player_definitions, diff --git a/openfut-import-fifa17/src/main.rs b/openfut-import-fifa17/src/main.rs index 147b75b..0b88c97 100644 --- a/openfut-import-fifa17/src/main.rs +++ b/openfut-import-fifa17/src/main.rs @@ -123,6 +123,11 @@ fn run() -> Result { sum.supported_instances, sum.deferred_instances ); + println!( + " reclassify : {} (run `openfut-core reclassify ` to correct \ + content_kind on a club imported before the taxonomy existed)", + sum.reclassify.display() + ); println!( " non-player : {} definition(s), {} instance(s) (consumable/staff)", sum.non_player_definitions, sum.non_player_instances