change downloader options to data_rate
This commit is contained in:
parent
2a45c91175
commit
fe4dac8236
4 changed files with 11 additions and 11 deletions
|
@ -139,8 +139,8 @@ class EncryptedFileDownloaderFactory(object):
|
|||
def can_download(self, sd_validator):
|
||||
return True
|
||||
|
||||
def make_downloader(self, metadata, options, payment_rate_manager, **kwargs):
|
||||
payment_rate_manager.min_blob_data_payment_rate = options[0]
|
||||
def make_downloader(self, metadata, data_rate, payment_rate_manager, **kwargs):
|
||||
payment_rate_manager.min_blob_data_payment_rate = data_rate
|
||||
|
||||
def save_source_if_blob(stream_hash):
|
||||
if metadata.metadata_source == StreamMetadata.FROM_BLOB:
|
||||
|
|
|
@ -149,10 +149,8 @@ class ManagedEncryptedFileDownloaderFactory(object):
|
|||
return True
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def make_downloader(self, metadata, options, payment_rate_manager, download_directory=None,
|
||||
def make_downloader(self, metadata, data_rate, payment_rate_manager, download_directory=None,
|
||||
file_name=None):
|
||||
# TODO: change options argument to only be data_rate
|
||||
data_rate = options[0]
|
||||
stream_hash = yield save_sd_info(self.lbry_file_manager.stream_info_manager,
|
||||
metadata.validator.raw_info)
|
||||
if metadata.metadata_source == StreamMetadata.FROM_BLOB:
|
||||
|
|
|
@ -141,7 +141,7 @@ class FullLiveStreamDownloaderFactory(object):
|
|||
def can_download(self, sd_validator):
|
||||
return True
|
||||
|
||||
def make_downloader(self, metadata, options, payment_rate_manager):
|
||||
def make_downloader(self, metadata, data_rate, payment_rate_manager):
|
||||
# TODO: check options for payment rate manager parameters
|
||||
prm = LiveStreamPaymentRateManager(self.default_payment_rate_manager,
|
||||
payment_rate_manager)
|
||||
|
|
|
@ -119,11 +119,13 @@ class GetStream(object):
|
|||
|
||||
@defer.inlineCallbacks
|
||||
def get_downloader(self, factory, stream_metadata):
|
||||
downloader_options = [self.data_rate, True]
|
||||
downloader = yield factory.make_downloader(stream_metadata, downloader_options,
|
||||
self.payment_rate_manager,
|
||||
download_directory=self.download_directory,
|
||||
file_name=self.file_name)
|
||||
downloader = yield factory.make_downloader(
|
||||
stream_metadata,
|
||||
self.data_rate,
|
||||
self.payment_rate_manager,
|
||||
download_directory=self.download_directory,
|
||||
file_name=self.file_name
|
||||
)
|
||||
defer.returnValue(downloader)
|
||||
|
||||
def _pay_key_fee(self, address, fee_lbc, name):
|
||||
|
|
Loading…
Reference in a new issue