forked from LBRYCommunity/lbry-sdk
make payment_rate_manager in add_lbry_file() an optional argument, initialize it from Session if not specified
This commit is contained in:
parent
57117baab5
commit
6218df2a92
2 changed files with 4 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue