Merge pull request #266 from lbryio/blob-delete-revisited

do not delete the sd hash blob when deleting file blobs
This commit is contained in:
Akinwale Ariwodola 2018-08-29 01:01:00 +01:00 committed by GitHub
commit a5b67d4923
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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