Merge pull request #2957 from lbryio/file-list-download-path

added `download_path` as a filter for `file_list` command
This commit is contained in:
Lex Berezhny 2020-05-18 14:15:44 -04:00 committed by GitHub
commit eba430bbc0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 4 deletions

View file

@ -1965,10 +1965,11 @@ class Daemon(metaclass=JSONRPCServerType):
[--outpoint=<outpoint>] [--txid=<txid>] [--nout=<nout>]
[--channel_claim_id=<channel_claim_id>] [--channel_name=<channel_name>]
[--claim_name=<claim_name>] [--blobs_in_stream=<blobs_in_stream>]
[--blobs_remaining=<blobs_remaining>] [--uploading_to_reflector=<uploading_to_reflector>]
[--is_fully_reflected=<is_fully_reflected>] [--status=<status>] [--completed=<completed>]
[--sort=<sort_by>] [--comparison=<comparison>] [--full_status=<full_status>] [--reverse]
[--page=<page>] [--page_size=<page_size>] [--wallet_id=<wallet_id>]
[--download_path=<download_path>] [--blobs_remaining=<blobs_remaining>]
[--uploading_to_reflector=<uploading_to_reflector>] [--is_fully_reflected=<is_fully_reflected>]
[--status=<status>] [--completed=<completed>] [--sort=<sort_by>] [--comparison=<comparison>]
[--full_status=<full_status>] [--reverse] [--page=<page>] [--page_size=<page_size>]
[--wallet_id=<wallet_id>]
Options:
--sd_hash=<sd_hash> : (str) get file with matching sd hash
@ -1985,6 +1986,7 @@ class Daemon(metaclass=JSONRPCServerType):
--channel_name=<channel_name> : (str) get file with matching channel name
--claim_name=<claim_name> : (str) get file with matching claim name
--blobs_in_stream<blobs_in_stream> : (int) get file with matching blobs in stream
--download_path=<download_path> : (str) get file with matching download path
--uploading_to_reflector=<uploading_to_reflector> : (bool) get files currently uploading to reflector
--is_fully_reflected=<is_fully_reflected> : (bool) get files that have been uploaded to reflector
--status=<status> : (str) match by status, ( running | finished | stopped )

View file

@ -27,6 +27,7 @@ class SourceManager:
'status',
'file_name',
'added_on',
'download_path',
'claim_name',
'claim_height',
'claim_id',

View file

@ -120,6 +120,10 @@ class ManagedStream(ManagedDownloadSource):
def mime_type(self):
return guess_media_type(os.path.basename(self.descriptor.suggested_file_name))[0]
@property
def download_path(self):
return f"{self.download_directory}/{self._file_name}" if self.download_directory and self._file_name else None
# @classmethod
# async def create(cls, loop: asyncio.AbstractEventLoop, config: 'Config',
# file_path: str, key: Optional[bytes] = None,