fix: The url output by the list_operator is null

The url can be output in the first or last data obtained by list_operator. After reference, url is not a field of File model, but a field processed by self.generate_url(). However, the code uses the direct output of remote_url, which is often an incomplete field or null, so it is more reasonable to replace it with a field generated by generate_url()
This commit is contained in:
sunxiaojia123 2024-11-12 17:50:38 +08:00 committed by GitHub
parent 62642443ef
commit c83fbb789a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -176,7 +176,7 @@ def _get_file_extract_string_func(*, key: str) -> Callable[[File], str]:
case "transfer_method": case "transfer_method":
return lambda x: x.transfer_method return lambda x: x.transfer_method
case "url": case "url":
return lambda x: x.remote_url or "" return lambda x: x.generate_url() or ""
case _: case _:
raise InvalidKeyError(f"Invalid key: {key}") raise InvalidKeyError(f"Invalid key: {key}")