refactor(types): govern TMDb credit response contract

This commit is contained in:
jxxghp
2026-10-16 23:49:41 +08:00
parent 2e339683f5
commit b002432691
2 changed files with 6 additions and 3 deletions

View File

@@ -1,12 +1,14 @@
from ..tmdb import TMDb
from ..tmdb import TMDb, TMDbJson
class Credit(TMDb):
"""按身份标识查询电影或剧集演职员详情。"""
_urls = {
"details": "/credit/%s"
}
def details(self, credit_id):
def details(self, credit_id: int | str) -> TMDbJson:
"""
Get a movie or TV credit details by id.
:param credit_id: int
@@ -14,7 +16,7 @@ class Credit(TMDb):
"""
return self._request_obj(self._urls["details"] % credit_id)
async def async_details(self, credit_id):
async def async_details(self, credit_id: int | str) -> TMDbJson:
"""
Get a movie or TV credit details by id.(异步版本)
:param credit_id: int

View File

@@ -179,4 +179,5 @@ files =
app/modules/themoviedb/tmdbv3api/objs/certification.py,
app/modules/themoviedb/tmdbv3api/objs/configuration.py,
app/modules/themoviedb/tmdbv3api/objs/provider.py,
app/modules/themoviedb/tmdbv3api/objs/credit.py,
scripts/architecture/async_blocking.py