From cacc65d45ed95aacf5b30c75ccc408f5213c65d8 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Mon, 6 May 2019 18:18:12 -0300 Subject: [PATCH] fix edge case from test for single blob stream --- lbrynet/extras/daemon/storage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lbrynet/extras/daemon/storage.py b/lbrynet/extras/daemon/storage.py index eb8d14921..28ce23acf 100644 --- a/lbrynet/extras/daemon/storage.py +++ b/lbrynet/extras/daemon/storage.py @@ -157,7 +157,7 @@ def store_stream(transaction: sqlite3.Connection, sd_blob: 'BlobFile', descripto transaction.executemany( "insert or ignore into blob values (?, ?, ?, ?, ?, ?, ?)", [(blob.blob_hash, blob.length, 0, 0, "pending", 0, 0) - for blob in descriptor.blobs[:-1] + [sd_blob]] + for blob in (descriptor.blobs[:-1] if len(descriptor.blobs) > 1 else descriptor.blobs) + [sd_blob]] ) # associate the blobs to the stream transaction.execute("insert or ignore into stream values (?, ?, ?, ?, ?)",