fix for file.list api pagination
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
from typing import Any
|
||||
from unicodedata import normalize
|
||||
|
||||
from pydantic.dataclasses import dataclass
|
||||
|
||||
@ -25,3 +26,8 @@ class File:
|
||||
@property
|
||||
def updated_at_name(self) -> str:
|
||||
return iso8601_to_user_friendly(self.updated_at)
|
||||
|
||||
|
||||
def find_file(files: list[File], name: str) -> File | None:
|
||||
_name = normalize("NFC", name).lower()
|
||||
return next((x for x in files if x.name.lower() == _name), None)
|
||||
|
Reference in New Issue
Block a user