remove message field from lbry file json, add blobs_completed, blobs_in_stream, and status fields

This commit is contained in:
Jack Robison 2017-12-07 13:54:18 -05:00
parent fb65536f18
commit 330d0465b6
No known key found for this signature in database
GPG key ID: 284699E7404E3CFF
2 changed files with 16 additions and 8 deletions

View file

@ -27,13 +27,14 @@ at anytime.
* Check claim schema in `publish` before trying to make the claim, return better error messages
* Renamed `channel_list_mine` to `channel_list`
* Changed `channel_list` to include channels where the certificate info has been imported but the claim is not in the wallet
* Changed file objects returned by `file_list` and `get` to no longer contain `name`, `claim_id`, or `metadata`
* Changed file objects returned by `file_list` and `get` to no longer contain `name`, `claim_id`, `message`, or `metadata`
* Increased assumption for time it takes to announce single hash from 1 second to 5 seconds
* Don't set HTTP error codes for failed api requests, conform to http://www.jsonrpc.org/specification#error_object
* Return less verbose tracebacks for api requests resulting in errors
* Don't include file names when logging information about streams, only include sd hashes
### Added
* Added `status`, `blobs_completed`, and `blobs_in_stream` fields to file objects returned by `file_list` and `get`
* Added `channel_import` and `channel_export` commands
* Added `is_mine` field to `channel_list` results
* Added `claim_renew` command

View file

@ -867,13 +867,14 @@ class Daemon(AuthJSONRPCServer):
else:
written_bytes = 0
size = message = outpoint = None
size = outpoint = num_completed = num_known = status = None
if full_status:
size = yield lbry_file.get_total_bytes()
file_status = yield lbry_file.status()
message = STREAM_STAGES[2][1] % (file_status.name, file_status.num_completed,
file_status.num_known, file_status.running_status)
num_completed = file_status.num_completed
num_known = file_status.num_known
status = file_status.running_status
outpoint = yield self.stream_info_manager.get_file_outpoint(lbry_file.rowid)
result = {
@ -891,7 +892,9 @@ class Daemon(AuthJSONRPCServer):
'key': key,
'total_bytes': size,
'written_bytes': written_bytes,
'message': message,
'blobs_completed': num_completed,
'blobs_in_stream': num_known,
'status': status,
'outpoint': outpoint
}
defer.returnValue(result)
@ -1290,7 +1293,9 @@ class Daemon(AuthJSONRPCServer):
'key': (str) key attached to file,
'total_bytes': (int) file size in bytes, None if full_status is false,
'written_bytes': (int) written size in bytes,
'message': (str), status message, None if full_status is false
'blobs_completed': (int) num_completed, None if full_status is false,
'blobs_in_stream': (int) None if full_status is false,
'status': (str) downloader status, None if full_status is false,
'outpoint': (str), None if full_status is false or if claim is not found
},
]
@ -1491,8 +1496,10 @@ class Daemon(AuthJSONRPCServer):
'key': (str) key attached to file,
'total_bytes': (int) file size in bytes, None if full_status is false,
'written_bytes': (int) written size in bytes,
'message': (str) status message,
'outpoint': (str) claim outpoint
'blobs_completed': (int) num_completed, None if full_status is false,
'blobs_in_stream': (int) None if full_status is false,
'status': (str) downloader status, None if full_status is false,
'outpoint': (str), None if full_status is false or if claim is not found
}
"""