@@ -37,7 +37,7 @@ def __init__(self):
3737 def process (self , arg_str : str = None , channel : MessageChannel = None , userid : Union [str , int ] = None ) -> bool :
3838 """
3939 获取下载器中的种子列表,并执行转移
40- :param arg_str: 传入的参数 (种子hash和TMDB ID )
40+ :param arg_str: 传入的参数 (种子hash和TMDBID|类型 )
4141 :param channel: 消息通道
4242 :param userid: 用户ID
4343 """
@@ -59,6 +59,13 @@ def extract_hash_and_number(string: str):
5959 with lock :
6060 if arg_str :
6161 logger .info (f"开始转移下载器文件,参数:{ arg_str } " )
62+ # 解析中附带的类型
63+ args = arg_str .split ('|' )
64+ if len (args ) > 1 :
65+ mtype = MediaType (args [- 1 ])
66+ arg_str = args [0 ]
67+ else :
68+ mtype = None
6269 # 解析中种子hash,TMDB ID
6370 torrent_hash , tmdbid = extract_hash_and_number (arg_str )
6471 if not hash or not tmdbid :
@@ -67,10 +74,10 @@ def extract_hash_and_number(string: str):
6774 # 获取种子
6875 torrents : Optional [List [TransferTorrent ]] = self .list_torrents (hashs = torrent_hash )
6976 if not torrents :
70- logger .error (f"没有获取到种子,参数:{ arg_str } " )
77+ logger .error (f"没有获取到种子,参数:{ torrent_hash } " )
7178 return False
7279 # 查询媒体信息
73- arg_mediainfo = self .recognize_media (tmdbid = tmdbid )
80+ arg_mediainfo = self .recognize_media (mtype = mtype , tmdbid = tmdbid )
7481 else :
7582 arg_mediainfo = None
7683 logger .info ("开始执行下载器文件转移 ..." )
@@ -123,7 +130,7 @@ def extract_hash_and_number(string: str):
123130 channel = channel ,
124131 mtype = NotificationType .Manual ,
125132 title = f"{ torrent .title } 未识别到媒体信息,无法入库!\n "
126- f"回复:```\n /transfer { torrent .hash } [tmdbid]\n ``` 手动识别转移。" ,
133+ f"回复:```\n /transfer { torrent .hash } [tmdbid]|[类型] \n ``` 手动识别转移。" ,
127134 userid = userid ))
128135 # 新增转移失败历史记录
129136 self .transferhis .add (
0 commit comments