feat(reddit): read 命令输出 post_hint / url / preview / gallery 媒体列#1873
Open
huanghe wants to merge 1 commit into
Open
feat(reddit): read 命令输出 post_hint / url / preview / gallery 媒体列#1873huanghe wants to merge 1 commit into
huanghe wants to merge 1 commit into
Conversation
The read command dropped Reddit's media metadata. Surface four columns from the post payload so callers can tell link/image/gallery posts apart and fetch media: - post_hint - url_overridden_by_dest - preview_image_url (decoded from preview.images[0].source.url) - gallery_urls (decoded from gallery_data / media_metadata) Empty-string / empty-array fallbacks keep the row shape stable for text posts. Manifest regenerated.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
动机
Reddit
read命令此前丢弃了帖子的媒体元数据,调用方无法区分链接帖 / 图片帖 / 相册帖,也拿不到媒体地址。本 PR 在read的输出里补上 4 列:post_hinturl_overridden_by_destpreview_image_url(从preview.images[0].source.url解码 HTML 实体得到)gallery_urls(从gallery_data/media_metadata解码得到)兼容性
纯增量:仅新增列,未改动
type/author/score/text等既有字段。文本帖在这些字段上回落为空串 / 空数组,行结构保持稳定。cli-manifest.json已用npm run build-manifest重新生成(仅新增这 4 列)。测试
clis/reddit/read.test.js:18 个用例通过(覆盖 link/image/gallery 帖的字段抽取与文本帖的空值回落)。npm run check:silent-column-drop→ new=0 OK;tsc --noEmit通过。