This commit is contained in:
arabcoders 2025-09-08 18:07:24 +03:00
parent f417041f53
commit ae1b6dd470
2 changed files with 7 additions and 1 deletions

View file

@ -27,7 +27,7 @@ class Condition:
filter: str
"""The filter to run on info dict."""
cli: str
cli: str = ""
"""If matched append this to the download request and retry."""
extras: dict[str, Any] = field(default_factory=dict)

View file

@ -85,6 +85,12 @@ async def conditions_add(request: Request, encoder: Encoder, notify: EventBus) -
status=web.HTTPBadRequest.status_code,
)
if not item.get("cli"):
item["cli"] = ""
if not item.get("extras"):
item["extras"] = {}
if not item.get("id", None) or not validate_uuid(item.get("id"), version=4):
item["id"] = str(uuid.uuid4())