Sync from development - prepare for v0.2.0.9

This commit is contained in:
Omni
2025-12-31 20:56:47 +00:00
parent 2511c9334c
commit 0d84d2f2fe
14 changed files with 373 additions and 178 deletions

View File

@@ -15,29 +15,32 @@ _KEYWORD_PHRASES = (
)
def is_non_premium_indicator(line: str) -> bool:
def is_non_premium_indicator(line: str) -> tuple[bool, str | None]:
"""
Return True if the engine output line indicates a Nexus non-premium scenario.
Args:
line: Raw line emitted from the jackify-engine process.
Returns:
Tuple of (is_premium_error: bool, matched_pattern: str | None)
"""
if not line:
return False
return False, None
normalized = line.strip().lower()
if not normalized:
return False
return False, None
# Direct phrase detection
for phrase in _KEYWORD_PHRASES[:6]:
if phrase in normalized:
return True
return True, phrase
# Manual download + Nexus URL implies premium requirement in current workflows.
if "manual download" in normalized and ("nexusmods.com" in normalized or "nexus mods" in normalized):
return True
return True, "manual download + nexusmods.com"
return False
return False, None