fix: resolve video from images/video.json and .mp4 fallback in redbook knowledge loader#15
Open
shaocc1234 wants to merge 1 commit intoJamailar:mainfrom
Open
fix: resolve video from images/video.json and .mp4 fallback in redbook knowledge loader#15shaocc1234 wants to merge 1 commit intoJamailar:mainfrom
shaocc1234 wants to merge 1 commit intoJamailar:mainfrom
Conversation
…k knowledge loader
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.
问题描述
使用「知识库-小红书图文」导入视频笔记时,视频被错误渲染为图片。
当前行为:视频文件(images/video.mp4)被当作图片渲染:
期望行为:应渲染为可播放的视频播放器(Knowledge.tsx 已有此渲染逻辑):
根因
desktop/electron/core/knowledgeLoader.ts在加载小红书笔记时:meta.images渲染图片列表images/video.mp4或images/video.jsonWanderItem的video字段始终为 undefinedKnowledge.tsx因note.video不存在,走到了<img>分支修复内容
WanderItem接口新增video?: string字段images/video.json的url字段images数组中任意.mp4文件type从'note'修正为'video'数据格式兼容性
convert.py 生成的数据格式:
images/video.json(新增):{"type": "video", "url": "..."}两种格式均可被正确识别。