From d6983a25b01d8bb43c725de56f25314532381541 Mon Sep 17 00:00:00 2001 From: Jack Date: Wed, 4 May 2016 23:40:05 -0400 Subject: [PATCH] fix metadata problem in downloader and publisher --- lbrynet/lbrynet_daemon/LBRYDaemon.py | 8 ++++--- lbrynet/lbrynet_daemon/LBRYDownloader.py | 29 +++++++++++------------- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/lbrynet/lbrynet_daemon/LBRYDaemon.py b/lbrynet/lbrynet_daemon/LBRYDaemon.py index c30a1a539..a66a1ee25 100644 --- a/lbrynet/lbrynet_daemon/LBRYDaemon.py +++ b/lbrynet/lbrynet_daemon/LBRYDaemon.py @@ -905,9 +905,11 @@ class LBRYDaemon(jsonrpc.JSONRPC): return r def _setup_stream(stream_info): - stream_hash = stream_info['stream_hash'] - if isinstance(stream_hash, dict): - stream_hash = stream_hash['sd_hash'] + if 'sources' in stream_info.keys(): + stream_hash = stream_info['sources']['lbry_sd_hash'] + else: + stream_hash = stream_info['stream_hash'] + d = self._get_lbry_file_by_sd_hash(stream_hash) def _add_results(l): return defer.succeed((stream_info, l)) diff --git a/lbrynet/lbrynet_daemon/LBRYDownloader.py b/lbrynet/lbrynet_daemon/LBRYDownloader.py index 002bb179e..d62bdc3b1 100644 --- a/lbrynet/lbrynet_daemon/LBRYDownloader.py +++ b/lbrynet/lbrynet_daemon/LBRYDownloader.py @@ -90,25 +90,22 @@ class GetStream(object): self.resolved_name = name self.stream_info = stream_info if 'stream_hash' in self.stream_info.keys(): - self.description = self.stream_info['description'] - if 'key_fee' in self.stream_info.keys(): - self.key_fee = float(self.stream_info['key_fee']) - if 'key_fee_address' in self.stream_info.keys(): - self.key_fee_address = self.stream_info['key_fee_address'] - else: - self.key_fee_address = None - else: - self.key_fee = None - self.key_fee_address = None - self.stream_hash = self.stream_info['stream_hash'] - if isinstance(self.stream_hash, dict): - self.stream_hash = self.stream_hash['sd_hash'] - + elif 'sources' in self.stream_info.keys(): + self.stream_hash = self.stream_info['sources']['lbry_sd_hash'] else: - log.error("InvalidStreamInfoError in autofetcher: ", stream_info) raise InvalidStreamInfoError(self.stream_info) - + if 'description' in self.stream_info.keys(): + self.description = self.stream_info['description'] + if 'key_fee' in self.stream_info.keys(): + self.key_fee = float(self.stream_info['key_fee']) + if 'key_fee_address' in self.stream_info.keys(): + self.key_fee_address = self.stream_info['key_fee_address'] + else: + self.key_fee_address = None + else: + self.key_fee = None + self.key_fee_address = None if self.key_fee > self.max_key_fee: if self.pay_key: log.info("Key fee (" + str(self.key_fee) + ") above limit of " + str(