Skip to content

Commit 7301ef2

Browse files
committed
Fix .size method to use IPFS object_stat, not block_stat.
1 parent 439ae9f commit 7301ef2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ipfs_storage/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import ipfsapi
88

99

10-
__version__ = '0.0.3'
10+
__version__ = '0.0.4'
1111

1212

1313
@deconstructible
@@ -65,7 +65,7 @@ def get_available_name(self, name, max_length=None):
6565

6666
def size(self, name: str) -> int:
6767
"""Total size, in bytes, of IPFS content with multihash `name`."""
68-
return self._ipfs_client.block_stat(name)['CumulativeSize']
68+
return self._ipfs_client.object_stat(name)['CumulativeSize']
6969

7070
def delete(self, name: str):
7171
"""Unpin IPFS content from the daemon."""

0 commit comments

Comments
 (0)