From 8924bf0fbb43d7716eecb2ba6d8974e9eef4ac26 Mon Sep 17 00:00:00 2001 From: Alan Shaw Date: Wed, 22 May 2019 10:37:02 +0100 Subject: [PATCH 1/2] fix: upgrade for 0.36 The IPLD dag-pb format changed in 0.36 to more closely follow it's serialized form. See the release notes for more info https://github.com/ipfs/js-ipfs/issues/2024 --- src/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/index.js b/src/index.js index 5574951..b8e621b 100644 --- a/src/index.js +++ b/src/index.js @@ -67,11 +67,11 @@ function getFile(ipfs, rootHash, filename, callback) { var hash = null var fileSize, fileName - _.each(res.links, function(link) { - if (link.name === filename) { - hash = link.multihash - fileSize = link.size - fileName = link.name + _.each(res.Links, function(link) { + if (link.Name === filename) { + hash = link.Hash + fileSize = link.Tsize + fileName = link.Name return false } }); From da6d12f404c9ccfa62a95f5898a7d59a515c68d1 Mon Sep 17 00:00:00 2001 From: Alan Shaw Date: Wed, 22 May 2019 10:40:13 +0100 Subject: [PATCH 2/2] fix: property name --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 33680bb..a36c7a2 100644 --- a/src/index.js +++ b/src/index.js @@ -64,7 +64,7 @@ function getFile(ipfs, rootHash, filename, callback) { var hash = null var fileSize, fileName - res.links.forEach(function(link) { + res.Links.forEach(function(link) { if (link.Name === filename) { hash = link.Hash fileSize = link.Tsize