diff --git a/lbrynet/lbryfilemanager/EncryptedFileDownloader.py b/lbrynet/lbryfilemanager/EncryptedFileDownloader.py index 887e7966a..c00a3ebe3 100644 --- a/lbrynet/lbryfilemanager/EncryptedFileDownloader.py +++ b/lbrynet/lbryfilemanager/EncryptedFileDownloader.py @@ -108,12 +108,16 @@ class ManagedEncryptedFileDownloader(EncryptedFileSaver): num_blobs_known, status)) @defer.inlineCallbacks - def load_file_attributes(self): - sd_hash = yield self.stream_info_manager.get_sd_blob_hashes_for_stream(self.stream_hash) - if sd_hash: - self.sd_hash = sd_hash[0] + def load_file_attributes(self, sd_hash=None): + if not sd_hash: + sd_hash = yield self.stream_info_manager.get_sd_blob_hashes_for_stream(self.stream_hash) + if sd_hash: + self.sd_hash = sd_hash[0] + else: + raise NoSuchStreamHash(self.stream_hash) else: - raise NoSuchStreamHash(self.stream_hash) + self.sd_hash = sd_hash + stream_metadata = yield self.wallet.get_claim_metadata_for_sd_hash(self.sd_hash) if stream_metadata: name, txid, nout = stream_metadata diff --git a/lbrynet/lbrynet_daemon/Publisher.py b/lbrynet/lbrynet_daemon/Publisher.py index 241798a5b..56438219c 100644 --- a/lbrynet/lbrynet_daemon/Publisher.py +++ b/lbrynet/lbrynet_daemon/Publisher.py @@ -41,7 +41,7 @@ class Publisher(object): claim_out = yield self.make_claim(name, bid, claim_dict) self.lbry_file.completed = True - yield self.lbry_file.load_file_attributes() + yield self.lbry_file.load_file_attributes(sd_hash) yield self.lbry_file.save_status() defer.returnValue(claim_out)