add streaming_url to file api response type

This commit is contained in:
Jack Robison 2019-05-13 19:05:26 -04:00
parent 26d183cbab
commit fd19daad9e
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2
2 changed files with 2 additions and 0 deletions

View file

@ -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',

View file

@ -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,