file_name as a property of managed stream, to reflect internal changes

This commit is contained in:
Victor Shyba 2019-02-13 20:41:26 -03:00 committed by Lex Berezhny
parent fc0c949187
commit bbdc96e762

View file

@ -27,7 +27,7 @@ class ManagedStream:
self.loop = loop self.loop = loop
self.blob_manager = blob_manager self.blob_manager = blob_manager
self.download_directory = download_directory self.download_directory = download_directory
self.file_name = file_name self._file_name = file_name
self.descriptor = descriptor self.descriptor = descriptor
self.downloader = downloader self.downloader = downloader
self.stream_hash = descriptor.stream_hash self.stream_hash = descriptor.stream_hash
@ -35,6 +35,10 @@ class ManagedStream:
self._status = status self._status = status
self.fully_reflected = asyncio.Event(loop=self.loop) self.fully_reflected = asyncio.Event(loop=self.loop)
@property
def file_name(self):
return self.downloader.output_file_name if self.downloader else self._file_name
@property @property
def status(self) -> str: def status(self) -> str:
return self._status return self._status