mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-03-19 19:46:55 +08:00
refactor: enhance tool message handling and improve error logging
- Updated _send_tool_message to accept a title parameter for better message context. - Modified various tool implementations to utilize the new title parameter for clearer messaging. - Improved error logging across multiple tools to include exception details for better debugging.
This commit is contained in:
@@ -20,14 +20,14 @@ class QuerySubscribesTool(MoviePilotTool):
|
||||
subscribes = subscribe_oper.list()
|
||||
filtered_subscribes = []
|
||||
for sub in subscribes:
|
||||
if status != "all" and sub.status != status:
|
||||
if status != "all" and sub.state != status:
|
||||
continue
|
||||
if media_type != "all" and sub.type != media_type:
|
||||
continue
|
||||
filtered_subscribes.append(sub)
|
||||
if filtered_subscribes:
|
||||
return json.dumps([s.dict() for s in filtered_subscribes], ensure_ascii=False, indent=2)
|
||||
return json.dumps([s.to_dict() for s in filtered_subscribes], ensure_ascii=False, indent=2)
|
||||
return "未找到相关订阅。"
|
||||
except Exception as e:
|
||||
logger.error(f"查询订阅失败: {e}")
|
||||
logger.error(f"查询订阅失败: {e}", exc_info=True)
|
||||
return f"查询订阅时发生错误: {str(e)}"
|
||||
|
||||
Reference in New Issue
Block a user