generated from coulomb/repo-seed
content-addressed blob storage: blob_storage.py, memory, local, and S3 adapters
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user