@@ -156,44 +156,44 @@ export default function useZarrMetadata() {
156
156
fileBrowserState . currentFileOrFolder . path
157
157
) ;
158
158
159
- const zarrayFile = getFile ( '.zarray' ) ;
160
- if ( zarrayFile ) {
161
- await checkZarrArray ( imageUrl , 2 , signal ) ;
162
- } else {
163
- const zattrsFile = getFile ( '.zattrs' ) ;
164
- if ( zattrsFile ) {
165
- const attrs = ( await fetchFileAsJson (
166
- fileBrowserState . currentFileSharePath . name ,
167
- zattrsFile . path ,
168
- cookies
169
- ) ) as any ;
170
- if ( signal . aborted ) {
171
- return ;
172
- }
173
- if ( attrs . multiscales ) {
174
- await checkOmeZarrMetadata ( imageUrl , 2 , signal ) ;
159
+ const zarrJsonFile = getFile ( 'zarr.json' ) ;
160
+ if ( zarrJsonFile ) {
161
+ const attrs = ( await fetchFileAsJson (
162
+ fileBrowserState . currentFileSharePath . name ,
163
+ zarrJsonFile . path ,
164
+ cookies
165
+ ) ) as any ;
166
+ if ( signal . aborted ) {
167
+ return ;
168
+ }
169
+ if ( attrs . node_type === 'array' ) {
170
+ await checkZarrArray ( imageUrl , 3 , signal ) ;
171
+ } else if ( attrs . node_type === 'group' ) {
172
+ if ( attrs . attributes ?. ome ?. multiscales ) {
173
+ await checkOmeZarrMetadata ( imageUrl , 3 , signal ) ;
174
+ } else {
175
+ log . info ( 'Zarrv3 group has no multiscales' , attrs . attributes ) ;
175
176
}
176
177
} else {
177
- const zarrJsonFile = getFile ( 'zarr.json' ) ;
178
- if ( zarrJsonFile ) {
178
+ log . warn ( 'Unknown Zarrv3 node type' , attrs . node_type ) ;
179
+ }
180
+ } else {
181
+ const zarrayFile = getFile ( '.zarray' ) ;
182
+ if ( zarrayFile ) {
183
+ await checkZarrArray ( imageUrl , 2 , signal ) ;
184
+ } else {
185
+ const zattrsFile = getFile ( '.zattrs' ) ;
186
+ if ( zattrsFile ) {
179
187
const attrs = ( await fetchFileAsJson (
180
188
fileBrowserState . currentFileSharePath . name ,
181
- zarrJsonFile . path ,
189
+ zattrsFile . path ,
182
190
cookies
183
191
) ) as any ;
184
192
if ( signal . aborted ) {
185
193
return ;
186
194
}
187
- if ( attrs . node_type === 'array' ) {
188
- await checkZarrArray ( imageUrl , 3 , signal ) ;
189
- } else if ( attrs . node_type === 'group' ) {
190
- if ( attrs . attributes ?. ome ?. multiscales ) {
191
- await checkOmeZarrMetadata ( imageUrl , 3 , signal ) ;
192
- } else {
193
- log . info ( 'Zarrv3 group has no multiscales' , attrs . attributes ) ;
194
- }
195
- } else {
196
- log . warn ( 'Unknown Zarrv3 node type' , attrs . node_type ) ;
195
+ if ( attrs . multiscales ) {
196
+ await checkOmeZarrMetadata ( imageUrl , 2 , signal ) ;
197
197
}
198
198
}
199
199
}
0 commit comments