feat: 完成Tab①采集旧数据
新增 CollectWorker,通过后台线程逐条采集旧标题和旧封面,成功后立即 db.set_collected 写库。 采集前按别名匹配账号并检测登录态;未匹配或未登录写 skipped,单条采集失败 mark_failed 后继续。 Tab① 增加采集/停止按钮和进度状态回传;补充 GUI 测试覆盖成功采集、未登录略过和未匹配略过;同步任务文档与 progress。
This commit is contained in:
@@ -401,3 +401,12 @@
|
||||
- 验证:`python -m unittest discover -s tests -p "test_gui.py"` 通过(9 tests);`python -m compileall app main.py tests` 通过;`python -m unittest discover -s tests` 通过(48 tests,skipped=1);`py -3 -m compileall app main.py tests` 通过;`py -3 -m unittest discover -s tests` 通过(34 tests,skipped=4,py -3 环境缺 openpyxl/PySide6,相关测试按设计跳过)。
|
||||
- 注意:本轮只改 GUI 汇总与过滤,不涉及 Shopee/CDP 页面操作,无需测试商品实跑。
|
||||
- 下一步:按任务看板领取 T-203(采集旧标题+旧封面,只读下载并立即写库)。
|
||||
|
||||
## 【2026-06-27】T-203 采集旧标题+旧封面
|
||||
|
||||
- 状态:DONE
|
||||
- 变更:`app/gui.py` 新增 `CollectWorker`,Tab① 增加「采集旧标题/旧封面」与「停止」按钮;worker 逐条处理 `stage=imported` 任务,别名未匹配写 `db.mark_skipped(..., "别名未匹配账号")`,账号未登录写 `mark_skipped`,已登录则调用 `editor.collect()` 下载旧封面到 `image_dir/<slug>/<item_id>_old.jpg` 并 `db.set_collected()`;单条失败 `mark_failed(..., "collect", error)` 后继续。更新 `tests/test_gui.py` 覆盖成功采集、未登录略过、未匹配略过;同步 `docs/06-tasks.md`、`docs/current-state.md`、`docs/api.md`。
|
||||
- 细节:采集通过 `BaseWorker/QThread` 后台执行,使用 signal 回传进度、行更新、失败和完成;GUI 线程只刷新表格与状态栏。停止使用协作式 cancel,正在执行的单条跑到安全边界后结束。
|
||||
- 验证:`python -m unittest discover -s tests -p "test_gui.py"` 通过(10 tests);`python -m compileall app main.py tests` 通过;`python -m unittest discover -s tests` 通过(49 tests,skipped=1);`py -3 -m compileall app main.py tests` 通过;`py -3 -m unittest discover -s tests` 通过(34 tests,skipped=4,py -3 环境缺 openpyxl/PySide6,相关测试按设计跳过)。
|
||||
- 注意:本轮未连接真实 Shopee/CDP 实跑采集,`accounts.detect_login()` 与 `editor.collect()` 路径由 mock 覆盖;接 T-204 前建议用测试商品和已登录账号做一次 Tab① 真机采集冒烟。
|
||||
- 下一步:按任务看板领取 T-204(回写旧字段到原 Excel,含文件锁处理)。
|
||||
|
||||
Reference in New Issue
Block a user