forked from LBRYCommunity/lbry-sdk
Merge pull request #2127 from lbryio/add-streaming-url
add `streaming_url` field to `File` api response type
This commit is contained in:
commit
46ee65c8f2
2 changed files with 2 additions and 0 deletions
|
@ -67,6 +67,7 @@ def encode_account_doc():
|
|||
|
||||
def encode_file_doc():
|
||||
return {
|
||||
'streaming_url': '(str) url to stream the file using range requests',
|
||||
'completed': '(bool) true if download is completed',
|
||||
'file_name': '(str) name of file',
|
||||
'download_directory': '(str) download directory',
|
||||
|
|
|
@ -213,6 +213,7 @@ class ManagedStream:
|
|||
download_directory = None
|
||||
written_bytes = None
|
||||
return {
|
||||
'streaming_url': f"http://{self.config.api_host}:{self.config.api_port}/stream/{self.sd_hash}",
|
||||
'completed': (self.output_file_exists and self.status in ('stopped', 'finished')) or all(
|
||||
self.blob_manager.is_blob_verified(b.blob_hash) for b in self.descriptor.blobs[:-1]),
|
||||
'file_name': file_name,
|
||||
|
|
Loading…
Reference in a new issue