mirror of
https://github.com/revanced/revanced-api.git
synced 2025-04-30 06:34:36 +02:00
feat: add download_count to releases (#118)
* feat: add download_count to releases * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
500a5896e3
commit
665b913c04
@ -49,14 +49,22 @@ class Asset(dict):
|
|||||||
Attributes:
|
Attributes:
|
||||||
- name (str): The name of the asset.
|
- name (str): The name of the asset.
|
||||||
- content_type (str): The MIME type of the asset content.
|
- content_type (str): The MIME type of the asset content.
|
||||||
|
- download_count (int): The number of times the asset has been downloaded.
|
||||||
- download_url (str): The URL to download the asset.
|
- download_url (str): The URL to download the asset.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, name: str, content_type: str, browser_download_url: str):
|
def __init__(
|
||||||
|
self,
|
||||||
|
name: str,
|
||||||
|
content_type: str,
|
||||||
|
download_count: int,
|
||||||
|
browser_download_url: str,
|
||||||
|
):
|
||||||
dict.__init__(
|
dict.__init__(
|
||||||
self,
|
self,
|
||||||
name=name,
|
name=name,
|
||||||
content_type=content_type,
|
content_type=content_type,
|
||||||
|
download_count=download_count,
|
||||||
browser_download_url=browser_download_url,
|
browser_download_url=browser_download_url,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -70,7 +70,8 @@ class Github(Backend):
|
|||||||
async def __assemble_release(release: dict) -> Release:
|
async def __assemble_release(release: dict) -> Release:
|
||||||
async def __assemble_asset(asset: dict) -> Asset:
|
async def __assemble_asset(asset: dict) -> Asset:
|
||||||
asset_data: dict = keyfilter(
|
asset_data: dict = keyfilter(
|
||||||
lambda key: key in {"name", "content_type", "browser_download_url"},
|
lambda key: key
|
||||||
|
in {"name", "content_type", "download_count", "browser_download_url"},
|
||||||
asset,
|
asset,
|
||||||
)
|
)
|
||||||
return Asset(**asset_data)
|
return Asset(**asset_data)
|
||||||
|
@ -23,6 +23,7 @@ class AssetFields(BaseModel):
|
|||||||
|
|
||||||
name: str
|
name: str
|
||||||
content_type: str
|
content_type: str
|
||||||
|
download_count: int
|
||||||
browser_download_url: str
|
browser_download_url: str
|
||||||
|
|
||||||
|
|
||||||
|
@ -1 +0,0 @@
|
|||||||
|
|
Loading…
x
Reference in New Issue
Block a user