@@ -360,6 +360,8 @@ def search(self, sid: Optional[int] = None, state: Optional[str] = 'N', manual:
360360 # 过滤搜索结果
361361 matched_contexts = []
362362 for context in contexts :
363+ if global_vars .is_system_stopped :
364+ break
363365 torrent_meta = context .meta_info
364366 torrent_info = context .torrent_info
365367 torrent_mediainfo = context .media_info
@@ -554,8 +556,12 @@ def match(self, torrents: Dict[str, List[Context]]):
554556 # 预识别所有未识别的种子
555557 processed_torrents : Dict [str , List [Context ]] = {}
556558 for domain , contexts in torrents .items ():
559+ if global_vars .is_system_stopped :
560+ break
557561 processed_torrents [domain ] = []
558562 for context in contexts :
563+ if global_vars .is_system_stopped :
564+ break
559565 # 如果种子未识别,尝试识别
560566 if not context .media_info or (not context .media_info .tmdb_id
561567 and not context .media_info .douban_id ):
@@ -626,6 +632,8 @@ def match(self, torrents: Dict[str, List[Context]]):
626632 continue
627633 logger .debug (f'开始匹配站点:{ domain } ,共缓存了 { len (contexts )} 个种子...' )
628634 for context in contexts :
635+ if global_vars .is_system_stopped :
636+ break
629637 # 提取信息
630638 _context = copy .copy (context )
631639 torrent_meta = _context .meta_info
@@ -867,6 +875,8 @@ def follow():
867875 success_count = 0
868876 subscribeoper = SubscribeOper ()
869877 for share_sub in share_subs :
878+ if global_vars .is_system_stopped :
879+ break
870880 uid = share_sub .get ("share_uid" )
871881 if uid and uid in follow_users :
872882 # 订阅已存在则跳过
0 commit comments