fix: migrate deprecated settings keys. update scripts to track deprecated Obtainium settings

This commit is contained in:
Richard Macias
2026-02-27 23:02:32 -06:00
parent 41a037a7f6
commit 9c9cbe0bc8
7 changed files with 69 additions and 37 deletions

View File

@@ -8,6 +8,7 @@ from urllib.parse import urlparse
from constants import (
COMMON_SETTINGS_KEYS,
DEPRECATED_SETTINGS_KEYS,
REGEX_SETTINGS_KEYS,
SOURCE_HOST_MAP,
SOURCE_SPECIFIC_KEYS,
@@ -57,7 +58,7 @@ def _detect_source_from_url(url: str) -> str | None:
def _valid_keys_for_source(source: str | None) -> set[str]:
valid = set(COMMON_SETTINGS_KEYS)
valid = set(COMMON_SETTINGS_KEYS) | set(DEPRECATED_SETTINGS_KEYS)
if source and source in SOURCE_SPECIFIC_KEYS:
valid |= SOURCE_SPECIFIC_KEYS[source]
return valid
@@ -184,6 +185,13 @@ def _validate_additional_settings(
if err:
errors.append(err)
# Warn on deprecated keys
for key, replacement in DEPRECATED_SETTINGS_KEYS.items():
if key in settings:
warnings.append(
f"{app_name}: deprecated key '{key}', use '{replacement}' instead"
)
# Check for source-inappropriate keys
url = app.get("url", "")
effective_source = app.get("overrideSource") or _detect_source_from_url(url)