Better groups
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 48/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript
- 领域
- api
调研方向
首先阅读 protoquery 中针对 GROUPSTART 和 GROUPEND 消息描述的查询行为。跟踪 10:bytes、10.1:var 和 10.5:string 等查询的解释方式;当嵌套的 repeated 字段可以直接查询,而无需先提取并重新解析每个子消息时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
I currently treat GROUPSTART messages like repeat messages, and pull all the bytes (up to and including GROUPEND) in protoquuery, so I can do this:
const medias = query(appTree, '10:bytes').map(i => {
const t = getTree(i)
return {
type: query(t, '1:var').pop(),
url: query(t, '5:string').pop()
}
})
expect(medias.length).toEqual(10)
const icon = medias.find(m => m.type === 4).url
const screenshots = medias.filter(m => m.type === 1).map(m => m.url)
const videos = medias.filter(m => m.type === 3).map(m => m.url)
const videoThumbs = medias.filter(m => m.type === 13).map(m => m.url)
and get this:
{
"icon": "https://play-lh.googleusercontent.com/qTt7JkhZ-U0kevENyTChyUijNUEctA3T5fh7cm8yzKUG0UAnMUgOMpG_9Ln7D24NbQ",
"screenshots": [
"https://play-lh.googleusercontent.com/m-S0SqOv428DZcm46NJlyv0pffYpfsNjWz6iyf9LVM1TCWbzWs3clWaugjfzXXnCTbY",
"https://play-lh.googleusercontent.com/WYyQPx2lhnCQYueR8q99NhIsxzJZX4NIHdlf0UxoPiwrHg1WlYGiFTy51F1aBZxaslE",
"https://play-lh.googleusercontent.com/ioUSrp79Yx_rZikYRI_XtK_mdP5kavcm9oWDWYrgVqXfS4bpW46y41lbGTQJT7tPn7ej",
"https://play-lh.googleusercontent.com/-8X4UtNoQm8k7cX7q5jT2fQmFFQbSJnreoxensBZQ7kuIs9d8FWwtyxM3QvqKd4SdBOA",
"https://play-lh.googleusercontent.com/_08ljE8yjFzGuroCP-6cemh2LIrQ_zptq5K4KLahsqAsCq5cjLSU-ghzkHhf2_0UZ9c",
"https://play-lh.googleusercontent.com/ofJcMSH2oJKzax3lscP-IJCZecGnkt7XWpt7L1J7KVhridE7wejHWqhrl4oV000sty1E"
],
"videos": [
"https://youtu.be/XT7YEb9_Muw"
],
"videoThumbs": [
"https://i.ytimg.com/vi/XT7YEb9_Muw/hqdefault.jpg"
]
}
It works, but it's a bit awkward to have to pull the sub-messages first (10:bytes) then parse each as a tree. I would rather it worked more like this:
const mediaTypes = query(appTree, '10.1:var')
const mediaUrls = query(appTree, '10.5:string')
Where 10 is considered a "repeating message field" and 1/5 are fields of that, which you can pull as normal types.
- 主要语言
- JavaScript
- 星标
- 1
- 派生
- 1
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
相似的 Issue
-
ai core enhancement good first issue testing
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
-
good first issue help wanted
难度 2/5 1-3 小时 新手友好度 88/100
-
cli: `studio --request <missing file>` answers with a raw ENOENT/EISDIR instead of a clear error可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭bug good first issue help wanted
难度 2/5 1-3 小时 新手友好度 88/100
laaielichter/Ai-edit-studio#81 ·
维护者通常 1 天内回复