mirror of
https://github.com/Omni-guides/Jackify.git
synced 2026-06-08 00:07:45 +02:00
Sync from development - prepare for v0.2.0.9
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user