Add --priority filter to loop command

Filters accounts by accountPriority (high/medium/low), as exported from Campaign Command Center.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-28 09:24:06 -04:00
parent 07eb9a5411
commit 45a93229e5
3 changed files with 10 additions and 4 deletions

View File

@@ -15,12 +15,15 @@ def _accounts() -> list[dict]:
return json.loads((config.DATA_DIR / "accounts.json").read_text())["accounts"]
def load_accounts(tier: str | None = None, account_id: str | None = None) -> list[dict]:
def load_accounts(tier: str | None = None, account_id: str | None = None,
priority: str | None = None) -> list[dict]:
accts = _accounts()
if account_id:
accts = [a for a in accts if a["accountId"] == account_id]
if tier:
accts = [a for a in accts if a["accountTier"] == tier]
if priority:
accts = [a for a in accts if (a.get("accountPriority") or "").lower() == priority]
return accts