28
28
from . import get_logger
29
29
from .consts import RETRY_STATUSES , dandiset_metadata_file
30
30
from .dandiapi import AssetType , BaseRemoteZarrAsset , RemoteDandiset
31
- from .dandiarchive import DandisetURL , ParsedDandiURL , SingleAssetURL , parse_dandi_url
31
+ from .dandiarchive import (
32
+ AssetItemURL ,
33
+ DandisetURL ,
34
+ ParsedDandiURL ,
35
+ SingleAssetURL ,
36
+ parse_dandi_url ,
37
+ )
32
38
from .dandiset import Dandiset
33
39
from .exceptions import NotFoundError
34
40
from .files import LocalAsset , find_dandi_files
@@ -227,7 +233,13 @@ def download_generator(self) -> Iterator[dict]:
227
233
"""
228
234
229
235
with self .url .navigate (strict = True ) as (client , dandiset , assets ):
230
- if isinstance (self .url , DandisetURL ) and self .get_metadata :
236
+ if (
237
+ isinstance (self .url , DandisetURL )
238
+ or (
239
+ isinstance (self .url , AssetItemURL )
240
+ and self .url .path == "dandiset.yaml"
241
+ )
242
+ ) and self .get_metadata :
231
243
assert dandiset is not None
232
244
for resp in _populate_dandiset_yaml (
233
245
self .output_path , dandiset , self .existing
@@ -236,6 +248,8 @@ def download_generator(self) -> Iterator[dict]:
236
248
"path" : str (self .output_prefix / dandiset_metadata_file ),
237
249
** resp ,
238
250
}
251
+ if isinstance (self .url , AssetItemURL ):
252
+ return
239
253
240
254
# TODO: do analysis of assets for early detection of needed renames
241
255
# etc to avoid any need for late treatment of existing and also for
0 commit comments