CBV01 commited on
Commit
d0e4595
·
1 Parent(s): 6c03b31

Resolved all remaining lints with robust loop-based lookup. restoring full performance.

Browse files
Files changed (1) hide show
  1. backend/main.py +3 -2
backend/main.py CHANGED
@@ -1299,7 +1299,7 @@ async def _scrape_telegram_search(base_query: str, rows: list, queue: Optional[a
1299
  # ZERO-COST REFINEMENT: Cross-reference chats ALREADY in the response.
1300
  # No extra API calls = 50x speed and no Bans.
1301
  res_chats = getattr(msg_results, 'chats', [])
1302
- chat_map = {c.id: c for c in res_chats} if res_chats else {}
1303
 
1304
  res_messages = getattr(msg_results, 'messages', [])
1305
  for msg in res_messages:
@@ -1308,7 +1308,8 @@ async def _scrape_telegram_search(base_query: str, rows: list, queue: Optional[a
1308
  peer_id = getattr(p_id, 'channel_id', None) or getattr(p_id, 'chat_id', None)
1309
  if not peer_id: continue
1310
 
1311
- chat = chat_map[peer_id] if peer_id in chat_map else None
 
1312
  if not chat: continue
1313
 
1314
  cid = str(chat.id)
 
1299
  # ZERO-COST REFINEMENT: Cross-reference chats ALREADY in the response.
1300
  # No extra API calls = 50x speed and no Bans.
1301
  res_chats = getattr(msg_results, 'chats', [])
1302
+ if not res_chats: continue
1303
 
1304
  res_messages = getattr(msg_results, 'messages', [])
1305
  for msg in res_messages:
 
1308
  peer_id = getattr(p_id, 'channel_id', None) or getattr(p_id, 'chat_id', None)
1309
  if not peer_id: continue
1310
 
1311
+ # Safe loop-based lookup avoids complex dict inference lints
1312
+ chat = next((c for c in res_chats if getattr(c, 'id', None) == peer_id), None)
1313
  if not chat: continue
1314
 
1315
  cid = str(chat.id)