From 17bc52239d3bf2c8b3d47a0dd7edbe2a433765ad Mon Sep 17 00:00:00 2001 From: jxxghp Date: Sat, 17 Oct 2026 07:40:18 +0800 Subject: [PATCH] fix(types): type TMDB collection methods --- .../themoviedb/tmdbv3api/objs/collection.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/modules/themoviedb/tmdbv3api/objs/collection.py b/app/modules/themoviedb/tmdbv3api/objs/collection.py index 4156c7ad8..8699e7770 100644 --- a/app/modules/themoviedb/tmdbv3api/objs/collection.py +++ b/app/modules/themoviedb/tmdbv3api/objs/collection.py @@ -1,4 +1,4 @@ -from ..tmdb import TMDb +from ..tmdb import TMDb, TMDbJson class Collection(TMDb): @@ -8,7 +8,7 @@ class Collection(TMDb): "translations": "/collection/%s/translations" } - def details(self, collection_id): + def details(self, collection_id: int | str) -> TMDbJson: """ Get collection details by id. :param collection_id: int @@ -16,7 +16,7 @@ class Collection(TMDb): """ return self._request_obj(self._urls["details"] % collection_id, key="parts") - def images(self, collection_id): + def images(self, collection_id: int | str) -> TMDbJson: """ Get the images for a collection by id. :param collection_id: int @@ -24,7 +24,7 @@ class Collection(TMDb): """ return self._request_obj(self._urls["images"] % collection_id) - def translations(self, collection_id): + def translations(self, collection_id: int | str) -> TMDbJson: """ Get the list translations for a collection by id. :param collection_id: int @@ -33,7 +33,7 @@ class Collection(TMDb): return self._request_obj(self._urls["translations"] % collection_id, key="translations") # 异步版本方法 - async def async_details(self, collection_id): + async def async_details(self, collection_id: int | str) -> TMDbJson: """ Get collection details by id.(异步版本) :param collection_id: int @@ -41,7 +41,7 @@ class Collection(TMDb): """ return await self._async_request_obj(self._urls["details"] % collection_id, key="parts") - async def async_images(self, collection_id): + async def async_images(self, collection_id: int | str) -> TMDbJson: """ Get the images for a collection by id.(异步版本) :param collection_id: int @@ -49,7 +49,7 @@ class Collection(TMDb): """ return await self._async_request_obj(self._urls["images"] % collection_id) - async def async_translations(self, collection_id): + async def async_translations(self, collection_id: int | str) -> TMDbJson: """ Get the list translations for a collection by id.(异步版本) :param collection_id: int