diff --git a/bioimageio_collection_backoffice/generate_collection_json.py b/bioimageio_collection_backoffice/generate_collection_json.py index 88a84156..fc5662b3 100644 --- a/bioimageio_collection_backoffice/generate_collection_json.py +++ b/bioimageio_collection_backoffice/generate_collection_json.py @@ -80,7 +80,10 @@ def maybe_swap_with_thumbnail( if isinstance(src, str): clean_name = Path(src).name # remove any leading './' - return thumbnails.get(clean_name, src) + if clean_name in thumbnails: + return p.get_file_url(thumbnails[clean_name]) + else: + return src return src diff --git a/bioimageio_collection_backoffice/remote_resource.py b/bioimageio_collection_backoffice/remote_resource.py index 64e021a7..19528ec1 100644 --- a/bioimageio_collection_backoffice/remote_resource.py +++ b/bioimageio_collection_backoffice/remote_resource.py @@ -255,6 +255,9 @@ def get_uploader(self): return Uploader(email=email, name=name) + def get_file_url(self, path: str): + return self.client.get_file_url(f"{self.folder}files/{path}") + def get_file_urls(self): return self.client.get_file_urls(f"{self.folder}files/")