From 850fab148486cb98601fc8915d68e0af299864dd Mon Sep 17 00:00:00 2001 From: CaoMeiYouRen <40430746+CaoMeiYouRen@users.noreply.github.com> Date: Fri, 6 Jun 2025 23:47:06 +0800 Subject: [PATCH] feat(xiaohongshu): update guid generation for user feeds and notes (#19302) --- lib/routes/xiaohongshu/user.ts | 2 +- lib/routes/xiaohongshu/util.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/routes/xiaohongshu/user.ts b/lib/routes/xiaohongshu/user.ts index 013793773..c36785b71 100644 --- a/lib/routes/xiaohongshu/user.ts +++ b/lib/routes/xiaohongshu/user.ts @@ -98,7 +98,7 @@ async function getUserFeeds(url: string, category: string) { n.map(({ id, noteCard }) => ({ title: noteCard.displayTitle, link: new URL(noteCard.noteId || id, url).toString(), - guid: noteCard.noteId || id || noteCard.displayTitle, + guid: new URL(noteCard.noteId || id, url).toString() || noteCard.displayTitle, description: `
${noteCard.displayTitle}`, author: noteCard.user.nickname, upvotes: noteCard.interactInfo.likedCount, diff --git a/lib/routes/xiaohongshu/util.ts b/lib/routes/xiaohongshu/util.ts index 864a28b9b..be5c5f96e 100644 --- a/lib/routes/xiaohongshu/util.ts +++ b/lib/routes/xiaohongshu/util.ts @@ -131,13 +131,14 @@ async function renderNotesFulltext(notes, urlPrex, displayLivePhoto) { const promises = notes.flatMap((note) => note.map(async ({ noteCard, id }) => { const link = `${urlPrex}/${id}`; + const guid = `${urlPrex}/${noteCard.noteId}`; const { title, description, pubDate, updated } = await getFullNote(link, displayLivePhoto); return { title, link, description, author: noteCard.user.nickName, - guid: noteCard.noteId, + guid, pubDate, updated, };