do not delete the sd hash blob when deleting file blobs

This commit is contained in:
Akinwale Ariwodola 2018-08-28 21:10:11 +01:00
parent 2a010e2643
commit 34a4df96fc

View file

@ -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 });
});
});