fix(together): アーカイブSQL構文エラー修正(JS側でホスト名判定に変更)
This commit is contained in:
parent
5d1b6dfb2b
commit
4f6be0a21e
15
server.js
15
server.js
|
|
@ -2632,17 +2632,16 @@ ${excerpt}
|
|||
}
|
||||
} catch (_) {}
|
||||
|
||||
// x.com など既存タイトルがドメイン名のみの場合は Jina タイトルで上書き
|
||||
// 既存タイトルがドメイン名のみの場合は Jina タイトルで上書き(JS 側で判定)
|
||||
let hostname = '';
|
||||
try { hostname = new URL(url).hostname.replace('www.', ''); } catch (_) {}
|
||||
const titleOverwrite = jinaTitle && hostname && jinaTitle !== hostname;
|
||||
await pool.query(
|
||||
`UPDATE together_shares
|
||||
SET full_content=$1,
|
||||
title=CASE
|
||||
WHEN title IS NULL THEN $2::text
|
||||
WHEN $2::text IS NOT NULL AND title = regexp_replace($3::text, '^https?://(www\.)?([^/]+).*$', '\2') THEN $2::text
|
||||
ELSE title
|
||||
END
|
||||
WHERE id=$4`,
|
||||
[fullContent, jinaTitle, url, shareId]
|
||||
title=CASE WHEN title IS NULL OR ($2::boolean AND title=$3::text) THEN $4::text ELSE title END
|
||||
WHERE id=$5`,
|
||||
[fullContent, titleOverwrite, hostname, jinaTitle, shareId]
|
||||
);
|
||||
|
||||
function parseGeminiJson(raw) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue