feat(collect): add product status recheck

This commit is contained in:
chengma
2026-07-18 18:09:07 +08:00
parent 3e9052e1b6
commit ba36b9fd8e
14 changed files with 985 additions and 32 deletions
+8
View File
@@ -138,6 +138,7 @@ def build_apply_plan(tasks, update_mode) -> dict:
STATUS_UNLISTED: [],
STATUS_REVIEWING: [],
STATUS_UNKNOWN: [],
"unverified": [],
}
normal_candidates = []
for task in base_candidates:
@@ -145,6 +146,8 @@ def build_apply_plan(tasks, update_mode) -> dict:
status_counts[status] += 1
if status == STATUS_NORMAL:
normal_candidates.append(task)
elif status == STATUS_UNKNOWN and not _has_status_snapshot(task):
status_excluded["unverified"].append(task)
else:
status_excluded[status].append(task)
@@ -174,6 +177,7 @@ def build_apply_plan(tasks, update_mode) -> dict:
"unlisted": status_excluded[STATUS_UNLISTED],
"reviewing": status_excluded[STATUS_REVIEWING],
"unknown": status_excluded[STATUS_UNKNOWN],
"unverified": status_excluded["unverified"],
"missing_title": missing_title,
"missing_cover": missing_cover,
"status_scope_excluded": status_excluded_count,
@@ -239,6 +243,10 @@ def _task_status(task) -> str:
return normalize_status(_task_value(task, "product_status"))
def _has_status_snapshot(task) -> bool:
return bool(str(_task_value(task, "product_status") or "").strip())
def _task_value(task, name, default=None):
if isinstance(task, dict):
return task.get(name, default)