@@ -121,8 +121,7 @@ class RootStats {
121121 ///
122122 /// For synchronous version, see [storesAvailable] . Note that this statistic is not cached for performance, as the effect would be negligible.
123123 Future <List <StoreDirectory >> get storesAvailableAsync async =>
124- (await _access.stores
125- .list ()
124+ (await (await _access.stores.listWithExists ())
126125 .map (
127126 (e) => e is Directory
128127 ? StoreDirectory (
@@ -143,12 +142,14 @@ class RootStats {
143142 /// Technically just sums up the size of all sub-stores, thus ignoring any cached root statistics, etc.
144143 ///
145144 /// Includes all files in all stores, not necessarily just tiles.
146- double get rootSize => double .parse (
145+ double get rootSize =>
146+ double .tryParse (
147147 _csgSync (
148148 'size' ,
149149 () => storesAvailable.map ((e) => e.stats.storeSize).sum,
150150 ),
151- );
151+ ) ??
152+ 0 ;
152153
153154 /// Retrieve the size of the root in kibibytes (KiB)
154155 ///
@@ -157,42 +158,48 @@ class RootStats {
157158 /// Technically just sums up the size of all sub-stores, thus ignoring any cached root statistics, etc.
158159 ///
159160 /// Includes all files in all stores, not necessarily just tiles.
160- Future <double > get rootSizeAsync async => double .parse (
161+ Future <double > get rootSizeAsync async =>
162+ double .tryParse (
161163 await _csgAsync (
162164 'size' ,
163165 () async => (await Future .wait (
164166 (await storesAvailableAsync).map ((e) => e.stats.storeSizeAsync),
165167 ))
166168 .sum,
167169 ),
168- );
170+ ) ??
171+ 0 ;
169172
170173 /// Retrieve the number of stored tiles in all sub-stores
171174 ///
172175 /// For asynchronous version, see [rootLengthAsync] .
173176 ///
174177 /// Only includes tiles stored, not necessarily all files.
175- int get rootLength => int .parse (
178+ int get rootLength =>
179+ int .tryParse (
176180 _csgSync (
177181 'length' ,
178182 () => storesAvailable.map ((e) => e.stats.storeLength).sum,
179183 ),
180- );
184+ ) ??
185+ 0 ;
181186
182187 /// Retrieve the number of stored tiles in all sub-stores
183188 ///
184189 /// For synchronous version, see [rootLength] .
185190 ///
186191 /// Only includes tiles stored, not necessarily all files.
187- Future <int > get rootLengthAsync async => int .parse (
192+ Future <int > get rootLengthAsync async =>
193+ int .tryParse (
188194 await _csgAsync (
189195 'length' ,
190196 () async => (await Future .wait (
191197 (await storesAvailableAsync).map ((e) => e.stats.storeLengthAsync),
192198 ))
193199 .sum,
194200 ),
195- );
201+ ) ??
202+ 0 ;
196203
197204 /// Watch for changes in the current cache
198205 ///
0 commit comments