diff --git a/app/modules/themoviedb/tmdbv3api/objs/network.py b/app/modules/themoviedb/tmdbv3api/objs/network.py index 80e50812e..7a10c6fa1 100644 --- a/app/modules/themoviedb/tmdbv3api/objs/network.py +++ b/app/modules/themoviedb/tmdbv3api/objs/network.py @@ -1,14 +1,16 @@ -from ..tmdb import TMDb +from ..tmdb import TMDb, TMDbJson class Network(TMDb): + """提供电视网络详情、别名和图像查询。""" + _urls = { "details": "/network/%s", "alternative_names": "/network/%s/alternative_names", "images": "/network/%s/images" } - def details(self, network_id): + def details(self, network_id: int | str) -> TMDbJson: """ Get a networks details by id. :param network_id: int @@ -16,7 +18,7 @@ class Network(TMDb): """ return self._request_obj(self._urls["details"] % network_id) - async def async_details(self, network_id): + async def async_details(self, network_id: int | str) -> TMDbJson: """ Get a networks details by id.(异步版本) :param network_id: int @@ -24,7 +26,7 @@ class Network(TMDb): """ return await self._async_request_obj(self._urls["details"] % network_id) - def alternative_names(self, network_id): + def alternative_names(self, network_id: int | str) -> TMDbJson: """ Get the alternative names of a network. :param network_id: int @@ -35,7 +37,7 @@ class Network(TMDb): key="results" ) - async def async_alternative_names(self, network_id): + async def async_alternative_names(self, network_id: int | str) -> TMDbJson: """ Get the alternative names of a network.(异步版本) :param network_id: int @@ -46,7 +48,7 @@ class Network(TMDb): key="results" ) - def images(self, network_id): + def images(self, network_id: int | str) -> TMDbJson: """ Get the TV network logos by id. :param network_id: int @@ -57,7 +59,7 @@ class Network(TMDb): key="logos" ) - async def async_images(self, network_id): + async def async_images(self, network_id: int | str) -> TMDbJson: """ Get the TV network logos by id.(异步版本) :param network_id: int diff --git a/mypy.ini b/mypy.ini index be9c02848..692c8d961 100644 --- a/mypy.ini +++ b/mypy.ini @@ -181,4 +181,5 @@ files = app/modules/themoviedb/tmdbv3api/objs/provider.py, app/modules/themoviedb/tmdbv3api/objs/credit.py, app/modules/themoviedb/tmdbv3api/objs/group.py, + app/modules/themoviedb/tmdbv3api/objs/network.py, scripts/architecture/async_blocking.py