mirror of
https://gitee.com/dify_ai/dify.git
synced 2024-12-03 11:48:08 +08:00
fix: list filter node url not work (#9540)
This commit is contained in:
parent
7742a5dac2
commit
53b14bde4d
@ -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…
Reference in New Issue
Block a user