From f1ebfff5bd29367d708cd1c139b1051402dbfa5b Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Mon, 30 Mar 2026 16:36:40 +0200 Subject: [PATCH] refactor: registry merge uses exclusion list instead of hardcoded fields --- scripts/common.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/scripts/common.py b/scripts/common.py index 91feaf17..f3ed4b10 100644 --- a/scripts/common.py +++ b/scripts/common.py @@ -215,11 +215,16 @@ def load_platform_config(platform_name: str, platforms_dir: str = "platforms") - elif isinstance(reg_cores, list) and cfg_cores is None: config["cores"] = reg_cores - # Merge other metadata: registry supplements missing fields - for field in ("hash_type", "verification_mode", "base_destination", - "case_insensitive_fs", "standalone_cores"): - if field in reg_entry and field not in config: - config[field] = reg_entry[field] + # Merge all registry fields not already in config. + # Skip registry-only metadata (not relevant to platform config). + _REGISTRY_ONLY = { + "config", "status", "logo", "scraper", "source_url", + "source_format", "schedule", "target_scraper", "target_source", + "inherits_from", "install", "cores", # cores handled above + } + for key, val in reg_entry.items(): + if key not in _REGISTRY_ONLY and key not in config: + config[key] = val _platform_config_cache[cache_key] = config return config