diff --git a/api/backends/entities.py b/api/backends/entities.py index a6b11ea..a47129e 100644 --- a/api/backends/entities.py +++ b/api/backends/entities.py @@ -49,14 +49,22 @@ class Asset(dict): Attributes: - name (str): The name of the asset. - 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. """ - 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__( self, name=name, content_type=content_type, + download_count=download_count, browser_download_url=browser_download_url, ) diff --git a/api/backends/github.py b/api/backends/github.py index 3faf303..b7bb875 100644 --- a/api/backends/github.py +++ b/api/backends/github.py @@ -70,7 +70,8 @@ class Github(Backend): async def __assemble_release(release: dict) -> Release: async def __assemble_asset(asset: dict) -> Asset: 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, ) return Asset(**asset_data) diff --git a/api/models/github.py b/api/models/github.py index b6f696a..e2f246a 100644 --- a/api/models/github.py +++ b/api/models/github.py @@ -23,6 +23,7 @@ class AssetFields(BaseModel): name: str content_type: str + download_count: int browser_download_url: str diff --git a/persistence/.gitkeep b/persistence/.gitkeep index d3f5a12..e69de29 100644 --- a/persistence/.gitkeep +++ b/persistence/.gitkeep @@ -1 +0,0 @@ -