From 34a4df96fc4051d26fa4e0a1c3f68c43dbab13c2 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Tue, 28 Aug 2018 21:10:11 +0100 Subject: [PATCH] do not delete the sd hash blob when deleting file blobs --- app/src/redux/actions/file.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/redux/actions/file.js b/app/src/redux/actions/file.js index 9821c11e..06a95556 100644 --- a/app/src/redux/actions/file.js +++ b/app/src/redux/actions/file.js @@ -45,7 +45,7 @@ export function doUpdateLoadStatus(uri, outpoint) { // Once a download has been completed, delete the individual blob files to save space Lbry.blob_list({ sd_hash: fileInfo.sd_hash }).then(hashes => { - hashes.forEach(hash => { + hashes.filter(hash => hash != fileInfo.sd_hash).forEach(hash => { Lbry.blob_delete({ blob_hash: hash }); }); }); @@ -325,7 +325,7 @@ export function doDeleteCompleteBlobs() { files.forEach(fileInfo => { if (fileInfo.completed) { Lbry.blob_list({ sd_hash: fileInfo.sd_hash }).then(hashes => { - hashes.forEach(hash => { + hashes.filter(hash => hash != fileInfo.sd_hash).forEach(hash => { Lbry.blob_delete({ blob_hash: hash }); }); });