From c5699db30a96ffb704c90768163d48bdbd70402d Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Mon, 10 Apr 2017 21:32:20 -0400 Subject: [PATCH 1/4] add channel name to file dict --- lbrynet/lbrynet_daemon/Daemon.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lbrynet/lbrynet_daemon/Daemon.py b/lbrynet/lbrynet_daemon/Daemon.py index a1674051a..7ddd5c7b8 100644 --- a/lbrynet/lbrynet_daemon/Daemon.py +++ b/lbrynet/lbrynet_daemon/Daemon.py @@ -918,6 +918,12 @@ class Daemon(AuthJSONRPCServer): metadata = claim['value'] else: metadata = None + + if claim and 'channel_name' in claim: + channel_name = claim['channel_name'] + else: + channel_name = None + if lbry_file.txid and lbry_file.nout is not None: outpoint = repr(ClaimOutpoint(lbry_file.txid, lbry_file.nout)) else: @@ -943,6 +949,7 @@ class Daemon(AuthJSONRPCServer): 'suggested_file_name': lbry_file.suggested_file_name, 'sd_hash': lbry_file.sd_hash, 'name': lbry_file.name, + 'channel_name': channel_name, 'outpoint': outpoint, 'claim_id': lbry_file.claim_id, 'download_path': full_path, From b644125e936385b4e0348394fc236b2915917d1c Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Mon, 10 Apr 2017 21:32:41 -0400 Subject: [PATCH 2/4] return None for failed resolve uri --- lbrynet/lbrynet_daemon/Daemon.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lbrynet/lbrynet_daemon/Daemon.py b/lbrynet/lbrynet_daemon/Daemon.py index 7ddd5c7b8..f52f8ca6a 100644 --- a/lbrynet/lbrynet_daemon/Daemon.py +++ b/lbrynet/lbrynet_daemon/Daemon.py @@ -1451,7 +1451,10 @@ class Daemon(AuthJSONRPCServer): } """ - resolved = yield self.session.wallet.resolve_uri(uri) + try: + resolved = yield self.session.wallet.resolve_uri(uri) + except Exception: + resolved = None results = yield self._render_response(resolved) defer.returnValue(results) From 023f81674cf2bd69a32b1ec75704ee0fd88fa3f8 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Mon, 10 Apr 2017 21:43:22 -0400 Subject: [PATCH 3/4] update requirements --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 97fafee2a..a5e1e8413 100644 --- a/setup.py +++ b/setup.py @@ -19,8 +19,8 @@ requires = [ 'envparse', 'jsonrpc', 'jsonschema', - 'lbryum>=2.7.16', - 'lbryschema>=0.0.2', + 'lbryum==2.7.17', + 'lbryschema==0.0.2', 'miniupnpc', 'pycrypto', 'pyyaml', From 63142df8653b555253e785ee08dded1dfe7a4fd4 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Mon, 10 Apr 2017 21:46:16 -0400 Subject: [PATCH 4/4] update changelog --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 50db405b7..b178ee6ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,8 +15,8 @@ at anytime. ### Changed * Use `uri` instead of `name` in `get_availability` - * - * + * Add `channel_name` to claim and file responses where applicable + * Return None (instead of errors) if a uri cannot be resolved ### Fixed * `file_list` for files with bad signatures