Sfoglia il codice sorgente

fix: list filter node url not work (#9540)

tags/0.10.0
非法操作 1 anno fa
parent
commit
53b14bde4d
Nessun account collegato all'indirizzo email del committer
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2
    2
      api/core/workflow/nodes/list_operator/node.py

+ 2
- 2
api/core/workflow/nodes/list_operator/node.py Vedi File

@@ -122,7 +122,7 @@ def _get_file_extract_string_func(*, key: str) -> Callable[[File], str]:
return lambda x: x.mime_type or ""
case "transfer_method":
return lambda x: x.transfer_method
case "urL":
case "url":
return lambda x: x.remote_url or ""
case _:
raise ValueError(f"Invalid key: {key}")
@@ -249,7 +249,7 @@ def _order_string(*, order: Literal["asc", "desc"], array: Sequence[str]):


def _order_file(*, order: Literal["asc", "desc"], order_by: str = "", array: Sequence[File]):
if order_by in {"name", "type", "extension", "mime_type", "transfer_method", "urL"}:
if order_by in {"name", "type", "extension", "mime_type", "transfer_method", "url"}:
extract_func = _get_file_extract_string_func(key=order_by)
return sorted(array, key=lambda x: extract_func(x), reverse=order == "desc")
elif order_by == "size":

Loading…
Annulla
Salva