fix: make xianyu notifications per-item with clickable links

This commit is contained in:
2026-05-06 23:30:25 +08:00
parent d5294a3f9b
commit ad48715664
13 changed files with 454 additions and 53 deletions
@@ -2,6 +2,7 @@
import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
import { buildItemLinks } from '../lib/links.mjs';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const ROOT = path.join(__dirname, '..');
@@ -76,7 +77,7 @@ function renderTask(task, limit) {
for (const { item, score, flags } of items) {
const price = item.detailPrice || item.price || '-';
const loc = item.sellerLocation || '-';
const href = item.href || item.url || '';
const href = buildItemLinks(item).primaryUrl || item.href || item.url || '';
lines.push(`### ${score}分|${item.title || '(无标题)'}`);
lines.push(`- 价格:${price}`);
lines.push(`- 地区/卖家:${loc}${item.sellerName ? ` / ${item.sellerName}` : ''}`);