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:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user