Merge pull request #606 from lbryio/channel-name-in-file-dict
Include channel name in claim and file responses
This commit is contained in:
commit
f53cde824e
3 changed files with 15 additions and 5 deletions
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
@ -1444,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)
|
||||
|
||||
|
|
4
setup.py
4
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',
|
||||
|
|
Loading…
Reference in a new issue