fix MediaType

This commit is contained in:
jxxghp
2023-07-07 15:41:53 +08:00
parent 89f2b60e7c
commit 39165a92f0
3 changed files with 4 additions and 4 deletions

View File

@ -53,7 +53,7 @@ async def create_subscribe(
"""
# 类型转换
if subscribe_in.type:
mtype = MediaType.TV if subscribe_in.type == "电视剧" else MediaType.MOVIE
mtype = MediaType(subscribe_in.type)
else:
mtype = None
# 标题转换

View File

@ -92,7 +92,7 @@ async def tmdb_info(tmdbid: int, type_name: str,
"""
根据TMDBID查询themoviedb媒体信息type_name: 电影/电视剧
"""
mtype = MediaType.MOVIE if type_name == MediaType.MOVIE.value else MediaType.TV
mtype = MediaType(type_name)
tmdbinfo = TmdbChain().tmdb_info(tmdbid=tmdbid, mtype=mtype)
if not tmdbinfo:
return schemas.MediaInfo()