claude/wonderful-brattain-d1cfe0 #4

Merged
zzz merged 16 commits from claude/wonderful-brattain-d1cfe0 into main 2026-05-21 09:58:35 +08:00
Member
No description provided.
zzz added 15 commits 2026-05-21 09:58:09 +08:00
这两个内嵌函数定义后从未被调用(grep 验证)。
time_utils.py 中已有公共版本可供未来使用。

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
将 fudai_detail_modules/ 6 个模块全部迁移到 douyin/fudai/core/:
- fudai_detail_coupon_detection.py
- fudai_detail_operations.py
- fudai_detail_room_title.py
- fudai_detail_utils.py
- fudai_detail_validator.py
- fudai_detail_reader.py -> fudai_detail_orchestrator.py(避免与 core/ 已有同名文件冲突)

更新所有 import:
- douyin/fudai/douyin_fudai_core.py
- douyin/fudai/douyin_fudai_detail.py

删除 fudai_detail_modules/ 空目录及其 README/__init__。

验证:python -m compileall 全项目通过。

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
这两个模块只被 douyin_logging_wrapper 内部使用,外部完全不引用。
合并为单文件 internal_loggers.py 减少模块数量。

douyin/logging/ 模块数:11 -> 10

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
action_tracker.py 只有 28 行,仅定义 track_action 装饰器,
该装饰器内部依赖 ActionLogger 和 PerformanceTracker,
合并到 action_logger.py 更内聚。

douyin/logging/ 模块数:10 -> 9

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
douyin_logger.py 提供的 get_logger 已被 douyin_logging.get_logger 覆盖。
唯一调用处(wrapper 中的回退路径)改为使用 douyin_logging.get_logger。

douyin/logging/ 模块数:9 -> 8

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
将 4 个模块级辅助函数及相关常量从 underlying_operations.py 抽离到
新建的 douyin/core/io_utils.py:
- _verify_png_integrity
- _safe_replace_file
- _ensure_parent_dir
- _mirror_screenshot_to_external
- _EXTERNAL_DOUYIN_FUDAI_DIR / _EXTERNAL_AXF_SCREENSHOT

underlying_operations.py 仍重新导出这些符号,保持向后兼容,
所有外部 import 无需修改。

文件行数:3508 -> 3342(减 166 行)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
douyin_fudai_core.py 中存在与 fudai_filter.py 完全重复的
is_watch_task_fudai 实现,_is_short_countdown_text 也属于过滤逻辑。
集中到 fudai_filter.py 后,douyin_fudai_core.py 保留薄包装函数
作为兼容 re-export,确保所有既有调用点继续工作。

文件行数:6393 -> 6347(减 46 行)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
check_lucky_draw_result / check_have_reward_notice_confirm /
check_in_order_confirm_page / get_reward 在 fudai_result_checker.py
中已有更新版本(使用 preprocess_for_ocr 等改进)。

douyin_fudai_core.py 中保留薄包装函数作为兼容 re-export,
确保任何旧调用点继续工作。

文件行数:6347 -> 6250(减 97 行)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
check_contain 在 fudai_filter.py 中已有完全相同的实现。
通过顶部 import 直接复用,删除 douyin_fudai_core.py 中的副本。

文件行数:6250 -> 6206(减 44 行)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
douyin_fudai_core.py 中的 should_skip_fudai_by_config (~480 行) 和
basic_join_decision (~1940 行) 与 fudai_filter.py 中的实现高度重复。
保留 fudai_filter.py 中的版本,删除 douyin_fudai_core.py 中的副本。

兼容性:保留薄包装函数,所有现有 import 路径继续工作。

文件行数:6206 -> 3799(减 2407 行,约 39%)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- device_operations.py:仅是空 stub(__all__ = []),无人使用
- image_operations.py:同上
- screenshot_service_new.py:未被引用的重复实现

operations/__init__.py 不导出这些模块,外部无依赖。

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
attend_choujiang 在 fudai_core.py 中的旧版本只是一个回退实现:
开头就先尝试委派到 fudai_attend.attend_choujiang(更新版本),
1597 行的本地实现实际上是死代码——只在 import 失败时才会执行,
而 fudai_attend.py 一直存在。

简化为薄包装函数,直接调用 fudai_attend 中的实现。

文件行数:3799 -> 2208(减 1591 行,约 42%)
本次会话累计 fudai_core 减少:6393 -> 2208(减 4185 行,65%)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
该文件只有一个函数 get_fudai_contain(1217 行),但无任何模块
import 它。所有调用方都用的是 douyin_fudai_core.get_fudai_contain。

注:本次 fudai_detail_modules/ 合并时引入的 fudai_detail_orchestrator.py
里的 get_fudai_contain 引用是从 douyin_fudai_core 来的,与本文件无关。

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
原本 64 行的 fallback 实现实际上是死代码——
gui.components.log_viewer.format_gui_log_line 一直存在,
import 失败几乎不可能发生。

简化为薄包装函数,import 失败时返回原字符串。

文件行数:5857 -> 5804(减 53 行)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
去除大规模拆分后剩余的死 import:
- PIL.Image (未引用)
- numpy as np (未引用)
- douyin_reservation_logic (未引用)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
zzz added 1 commit 2026-05-21 09:58:26 +08:00
zzz merged commit 0a0b59c908 into main 2026-05-21 09:58:35 +08:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: simgreek/douyi_guaji_main#4