make payment_rate_manager in add_lbry_file() an optional argument, initialize it from Session if not specified

This commit is contained in:
Kay Kurokawa 2017-11-10 16:37:51 -05:00 committed by Jack Robison
parent 57117baab5
commit 6218df2a92
No known key found for this signature in database
GPG key ID: 284699E7404E3CFF
2 changed files with 4 additions and 3 deletions

View file

@ -34,10 +34,9 @@ class Publisher(object):
with file_utils.get_read_handle(file_path) as read_handle:
stream_hash = yield create_lbry_file(self.session, self.lbry_file_manager, file_name,
read_handle)
prm = self.session.payment_rate_manager
sd_hash = yield publish_sd_blob(self.lbry_file_manager.stream_info_manager,
self.session.blob_manager, stream_hash)
self.lbry_file = yield self.lbry_file_manager.add_lbry_file(stream_hash, prm)
self.lbry_file = yield self.lbry_file_manager.add_lbry_file(stream_hash)
if 'source' not in claim_dict['stream']:
claim_dict['stream']['source'] = {}
claim_dict['stream']['source']['source'] = sd_hash

View file

@ -183,8 +183,10 @@ class EncryptedFileManager(object):
yield self._stop_lbry_file(lbry_file)
@defer.inlineCallbacks
def add_lbry_file(self, stream_hash, payment_rate_manager, blob_data_rate=None,
def add_lbry_file(self, stream_hash, payment_rate_manager=None, blob_data_rate=None,
download_directory=None, file_name=None):
if not payment_rate_manager:
payment_rate_manager = self.sesion.payment_rate_manager
rowid = yield self._save_lbry_file(stream_hash, blob_data_rate)
lbry_file = yield self.start_lbry_file(rowid, stream_hash, payment_rate_manager,
blob_data_rate, download_directory,