This commit is contained in:
2026-03-19 14:45:31 +08:00
parent cf3422b1ca
commit 3d5156ac3e
8 changed files with 805 additions and 735 deletions

View File

@@ -15,6 +15,11 @@ function pick_asin_from_url(url) {
return m && m[1] ? m[1].toUpperCase() : null;
}
/**
* 以“自然日(本地时区)”为口径判断当天是否已抓取过详情。
* - 详情数据写入 `amazon_product`,会更新 `updated_at`
* - 当 `updated_at >= 今日 00:00` 时,后续同日任务将跳过详情提取(仅抓评论)
*/
function get_today_start() {
const d = new Date();
d.setHours(0, 0, 0, 0);
@@ -214,6 +219,11 @@ export async function run_amazon_search_detail_reviews_flow(flow_payload) {
const asin = pick_asin_from_url(url);
const skip_detail = asin ? await has_detail_fetched_today(asin) : false;
/**
* 合并 action同一详情页 tab 内一次完成 detail + reviews减少两次打开页面/两次桥接调用)
* - 当 skip_detail=true插件只返回 reviewsdetail 不执行/不返回)
* - 返回结构:{ result: { detail?: {...}, reviews: {...} } }
*/
const res = await execute_action_and_record({
action_name: 'amazon_product_detail_reviews',
action_payload: { product_url: url, limit: reviews_limit, skip_detail },