fixes
This commit is contained in:
parent
f417041f53
commit
ae1b6dd470
2 changed files with 7 additions and 1 deletions
|
|
@ -27,7 +27,7 @@ class Condition:
|
||||||
filter: str
|
filter: str
|
||||||
"""The filter to run on info dict."""
|
"""The filter to run on info dict."""
|
||||||
|
|
||||||
cli: str
|
cli: str = ""
|
||||||
"""If matched append this to the download request and retry."""
|
"""If matched append this to the download request and retry."""
|
||||||
|
|
||||||
extras: dict[str, Any] = field(default_factory=dict)
|
extras: dict[str, Any] = field(default_factory=dict)
|
||||||
|
|
|
||||||
|
|
@ -85,6 +85,12 @@ async def conditions_add(request: Request, encoder: Encoder, notify: EventBus) -
|
||||||
status=web.HTTPBadRequest.status_code,
|
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):
|
if not item.get("id", None) or not validate_uuid(item.get("id"), version=4):
|
||||||
item["id"] = str(uuid.uuid4())
|
item["id"] = str(uuid.uuid4())
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue