Skip to content

Commit

Permalink
add versions_sha256
Browse files Browse the repository at this point in the history
  • Loading branch information
FynnBe committed Jun 10, 2024
1 parent 7ca6abc commit 935fc57
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions bioimageio_collection_backoffice/collection_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ class CollectionEntry(Node, frozen=True):
type: Literal["application", "model", "notebook", "dataset"]
versions: Sequence[str]
"""available versions of this resource. newest first"""
versions_sha256: Sequence[str]
"""SHA-256 of each versioned RDF"""
dois: Sequence[Optional[str]]
"""version specific dois of the available versions. newest first"""

Expand Down
12 changes: 8 additions & 4 deletions bioimageio_collection_backoffice/remote_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -1065,16 +1065,20 @@ def maybe_swap_with_thumbnail(
version_record_id: str = rdf["id"][concept_end + 1 :]
entry_id = concept_doi
legacy_download_count: int = LEGACY_DOWNLOAD_COUNTS.get(concept_doi, 0)
entry_versions = LEGACY_VERSIONS.get(concept_doi, [])
if version_record_id not in entry_versions:
entry_versions.append(version_record_id)
entry_versions = [
f"{concept_doi}/{v}" for v in LEGACY_VERSIONS.get(concept_doi, [])
]
if (
this_version_id := f"{concept_doi}/{version_record_id}"
) not in entry_versions:
entry_versions.append(this_version_id)

entry_dois = [f"10.5281/zenodo.{v}" for v in entry_versions]
else:
concept_doi = rv.concept_doi
entry_id = rdf["id"]
legacy_download_count = 0
entry_versions = [v.version for v in versions]
entry_versions = [v.id for v in versions]
entry_dois = [v.doi for v in versions]

if "/" in rdf["id"]:
Expand Down

0 comments on commit 935fc57

Please sign in to comment.