feat: Implement high-value room revisit feature and enhance fudai tracking
- Added tracking for previously seen fudai in Runner and ProcRunner classes to avoid duplicate recognition. - Extracted room title during fudai recognition for better tracking. - Updated high_value_rooms.json with new room entries and adjusted total count. - Introduced new GUI elements for configuring icon coordinates in webui. - Created comprehensive documentation for the high-value room revisit functionality. - Added tests for delay settings and icon detection logic to ensure functionality. - Implemented a tool for analyzing step times in logs to identify performance bottlenecks.
This commit is contained in:
1 parent
47e1a0cb2c
commit
b3011dd9ce
26 files changed
+1978
-1118
No files matched your search
+32
-19
@@ -155,6 +155,9 @@ class Runner:
|
||||
self._fudai_attend_ok_room_pos: set[int] = set()
|
||||
self._fudai_attend_fail_room_pos: set[int] = set()
|
||||
|
||||
# 已记录福袋识别的跟踪(避免同一个直播间同一个福袋重复记录识别次数)
|
||||
self._recorded_fudai_seen: set[tuple[str, str]] = set() # (room_title, fudai_content)
|
||||
|
||||
def is_running(self) -> bool:
|
||||
return self._proc is not None and self._proc.poll() is None
|
||||
|
||||
@@ -232,6 +235,7 @@ class Runner:
|
||||
# --- 福袋:抽取"最近一次"识别到的信息 ---
|
||||
# 支持多种格式:旧格式"福袋内容:"和新格式"字段_内容="或"内容="
|
||||
content_extracted = False
|
||||
room_title = ""
|
||||
if "福袋内容:" in s:
|
||||
with self._lock:
|
||||
self._fudai_last["content"] = (
|
||||
@@ -248,26 +252,35 @@ class Runner:
|
||||
self._fudai_last["updated_ts"] = time.time()
|
||||
content_extracted = True
|
||||
|
||||
# 提取直播间标题
|
||||
m = re.search(r"room_title[=:]\s*([^\s,]+)", s)
|
||||
if m:
|
||||
room_title = m.group(1).strip()
|
||||
|
||||
if content_extracted:
|
||||
self._inc("fudai_seen")
|
||||
self._record_event("fudai_seen", self._snapshot_fudai())
|
||||
# 唯一口径:优先按当前直播间位置去重(每个直播间只记一次),回退到 content/prize/countdown 三元组
|
||||
try:
|
||||
if self._current_room_pos is not None:
|
||||
try:
|
||||
rp = int(self._current_room_pos)
|
||||
except Exception:
|
||||
rp = None
|
||||
if rp is not None and rp not in self._fudai_seen_room_pos:
|
||||
self._fudai_seen_room_pos.add(rp)
|
||||
self._inc("fudai_seen_unique")
|
||||
else:
|
||||
key = self._make_unique_key()
|
||||
if key and key not in self._unique_keys_seen:
|
||||
self._unique_keys_seen.add(key)
|
||||
self._inc("fudai_seen_unique")
|
||||
except Exception:
|
||||
pass
|
||||
fudai_content = self._fudai_last.get("content", "")
|
||||
key = (room_title, fudai_content)
|
||||
if key not in self._recorded_fudai_seen:
|
||||
self._recorded_fudai_seen.add(key)
|
||||
self._inc("fudai_seen")
|
||||
self._record_event("fudai_seen", self._snapshot_fudai())
|
||||
# 唯一口径:优先按当前直播间位置去重(每个直播间只记一次),回退到 content/prize/countdown 三元组
|
||||
try:
|
||||
if self._current_room_pos is not None:
|
||||
try:
|
||||
rp = int(self._current_room_pos)
|
||||
except Exception:
|
||||
rp = None
|
||||
if rp is not None and rp not in self._fudai_seen_room_pos:
|
||||
self._fudai_seen_room_pos.add(rp)
|
||||
self._inc("fudai_seen_unique")
|
||||
else:
|
||||
key = self._make_unique_key()
|
||||
if key and key not in self._unique_keys_seen:
|
||||
self._unique_keys_seen.add(key)
|
||||
self._inc("fudai_seen_unique")
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# 参与人数:支持多种格式
|
||||
m = re.search(r"(?:字段_)?参与人数[=:]?\s*(\d+)", s)
|
||||
|
||||
Reference in new issue
Block a user