content-addressed blob storage: blob_storage.py, memory, local, and S3 adapters
This commit is contained in:
parent
c2bc7071d7
commit
ebace73761
22 changed files with 1489 additions and 47 deletions
|
|
@ -858,7 +858,9 @@ def _preferred_representation(
|
|||
RepresentationKind.NORMALIZED: 1,
|
||||
RepresentationKind.DERIVED: 2,
|
||||
}
|
||||
return sorted(representations, key=lambda item: priority.get(item.kind, 99))[0]
|
||||
best_priority = min(priority.get(item.kind, 99) for item in representations)
|
||||
candidates = [item for item in representations if priority.get(item.kind, 99) == best_priority]
|
||||
return sorted(candidates, key=lambda item: (item.created_at, item.representation_id), reverse=True)[0]
|
||||
|
||||
|
||||
def _normalize_path(path: str) -> str:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue