mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-03-20 03:57:30 +08:00
fix
This commit is contained in:
@@ -145,11 +145,6 @@ class GetRecommendationsTool(MoviePilotTool):
|
||||
logger.warning(f"推荐结果格式异常,跳过: {type(r)}")
|
||||
continue
|
||||
|
||||
# 处理 overview 字段,截断过长的描述
|
||||
overview = r.get("overview") or ""
|
||||
if overview and len(overview) > 200:
|
||||
overview = overview[:200] + "..."
|
||||
|
||||
simplified = {
|
||||
"title": r.get("title"),
|
||||
"en_title": r.get("en_title"),
|
||||
@@ -159,7 +154,6 @@ class GetRecommendationsTool(MoviePilotTool):
|
||||
"tmdb_id": r.get("tmdb_id"),
|
||||
"imdb_id": r.get("imdb_id"),
|
||||
"douban_id": r.get("douban_id"),
|
||||
"overview": overview,
|
||||
"vote_average": r.get("vote_average"),
|
||||
"poster_path": r.get("poster_path"),
|
||||
"detail_link": r.get("detail_link")
|
||||
|
||||
@@ -74,7 +74,6 @@ class QueryEpisodeScheduleTool(MoviePilotTool):
|
||||
"episode_number": episode.episode_number,
|
||||
"name": episode.name,
|
||||
"air_date": air_date,
|
||||
"overview": episode.overview,
|
||||
"runtime": episode.runtime,
|
||||
"vote_average": episode.vote_average,
|
||||
"still_path": episode.still_path,
|
||||
|
||||
@@ -139,9 +139,6 @@ class QueryPopularSubscribesTool(MoviePilotTool):
|
||||
"popularity": media_dict.get("popularity"), # 订阅人数
|
||||
"subscriber_count": media_dict.get("popularity") # 明确标注为订阅人数
|
||||
}
|
||||
# 截断过长的描述
|
||||
if simplified.get("overview") and len(simplified["overview"]) > 200:
|
||||
simplified["overview"] = simplified["overview"][:200] + "..."
|
||||
simplified_medias.append(simplified)
|
||||
|
||||
result_json = json.dumps(simplified_medias, ensure_ascii=False, indent=2)
|
||||
|
||||
@@ -222,7 +222,7 @@ async def read_userdata(
|
||||
user_data = await SiteUserData.async_get_by_domain(db, domain=site.domain, workdate=workdate)
|
||||
if not user_data:
|
||||
return schemas.Response(success=False, data=[])
|
||||
return schemas.Response(success=True, data=user_data)
|
||||
return schemas.Response(success=True, data=user_data.to_dict())
|
||||
|
||||
|
||||
@router.get("/test/{site_id}", summary="连接测试", response_model=schemas.Response)
|
||||
|
||||
Reference in New Issue
Block a user