diff --git a/lbrynet/daemon/Daemon.py b/lbrynet/daemon/Daemon.py index 308414cf7..c7016da02 100644 --- a/lbrynet/daemon/Daemon.py +++ b/lbrynet/daemon/Daemon.py @@ -2801,6 +2801,7 @@ class Daemon(AuthJSONRPCServer): Returns: (bool) true if successful """ + if announce_all: yield self.session.blob_manager.immediate_announce_all_blobs() else: @@ -2814,11 +2815,9 @@ class Daemon(AuthJSONRPCServer): else: raise Exception('single argument must be specified') if not blob_hash: - blobs = yield self.storage.get_blobs_for_stream(stream_hash) - blob_hashes.extend([blob.blob_hash for blob in blobs if blob.get_is_verified()]) - + blobs = yield self.storage.get_blobs_for_stream(stream_hash, only_completed=True) + blob_hashes.extend([blob.blob_hash for blob in blobs]) yield self.session.blob_manager._immediate_announce(blob_hashes) - response = yield self._render_response(True) defer.returnValue(response) diff --git a/lbrynet/database/storage.py b/lbrynet/database/storage.py index dcf305ae1..3e69944b7 100644 --- a/lbrynet/database/storage.py +++ b/lbrynet/database/storage.py @@ -389,11 +389,14 @@ class SQLiteStorage(object): stream_hash, blob_num ) - def get_blobs_for_stream(self, stream_hash): + def get_blobs_for_stream(self, stream_hash, only_completed=False): def _get_blobs_for_stream(transaction): crypt_blob_infos = [] - stream_blobs = transaction.execute("select blob_hash, position, iv from stream_blob " - "where stream_hash=?", (stream_hash, )).fetchall() + if only_completed: + query = "select blob_hash, position, iv from stream_blob where stream_hash=? and status='finished'" + else: + query = "select blob_hash, position, iv from stream_blob where stream_hash=?" + stream_blobs = transaction.execute(query, (stream_hash, )).fetchall() if stream_blobs: for blob_hash, position, iv in stream_blobs: if blob_hash is not None: