fix(together): x.com などドメイン名タイトルをJina取得タイトルで上書き

This commit is contained in:
posimai 2026-04-22 10:21:00 +09:00
parent 324d892b28
commit 7446568adf
1 changed files with 10 additions and 2 deletions

View File

@ -2632,9 +2632,17 @@ ${excerpt}
}
} catch (_) {}
// x.com など既存タイトルがドメイン名のみの場合は Jina タイトルで上書き
await pool.query(
`UPDATE together_shares SET full_content=$1, title=COALESCE(title, $2) WHERE id=$3`,
[fullContent, jinaTitle, shareId]
`UPDATE together_shares
SET full_content=$1,
title=CASE
WHEN title IS NULL THEN $2
WHEN $2 IS NOT NULL AND title = (regexp_replace($3, '^https?://(www\.)?', ''))::text THEN $2
ELSE title
END
WHERE id=$4`,
[fullContent, jinaTitle, url, shareId]
);
function parseGeminiJson(raw) {