-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add plugin method updateCards
#10065
Comments
附议 |
单独传 ids 可能不行,里面还涉及到很多计算操作是需要其他对象辅助。 siyuan/app/src/card/newCardTab.ts Line 16 in 4bb9f0e
如果是需要修改背诵顺序的话可以传个排序方法进来。 |
@Vanessa219 那传个回调,我排序+过滤行不? |
@Vanessa219 改动大的话就传个排序函数也行。尽量小改吧。 |
@IAliceBobI 大佬,过滤是指?和筛选一个意思吗?那这个需求有望通过您的插件在官方界面实现吗 |
大概意思就是实现类似supermeno一样的优先性队列。 |
@Jiangshuon 筛选需求奇奇怪怪的,没办法一网打尽。 |
update-cards
大家有空看看是否满足了? |
@Vanessa219 是每次都给全量闪卡来排序吗。排序后自动存储起来,下次复习时,就弹出按照这个顺序并且到期的哪些卡吗? |
@Vanessa219 是每次有一个闪卡改变都进行全量排序,还是找个位置进行插入而已?如果整体算法改变,还需要整体排序。 如果是复习前,就复习的那些闪卡排序也是OK的。 |
排序可以自己控制。 |
还有问题请教一下: 关于内部具体是如何处理的。 是每次加一个闪卡,或者复习一个闪卡一次,改变状态后,都全量闪卡排序? 把排序结果保存,下次复习拉出卡时,参考排序结果,播放闪卡? |
复习完一轮 |
发事件的机制,是不是相当于一边排序,一边复习。 排序要查询db。 |
你看一下 demo,可能和你想的不一样。
|
@Vanessa219 这是接收事件,处理的时候,你那边也不会阻塞等候吧。 另外,我排序需要根据ial,需要查一下db。可能会比较慢。 |
* commit '796df799315490e3a9d6e045f1c6bc98fb661e45': (455 commits) 🐛 Fix `name` attribute could not be visited in the plugin constructor (siyuan-note#10071) 🎨 Support ignore index siyuan-note#9198 ♻️ Rename func 🎨 siyuan-note#10090 🎨 Reduce the delay in adding rows in database table view siyuan-note#10082 🎨 Reduce the delay in adding rows in database table view siyuan-note#10082 🎨 siyuan-note#10065 🎨 Cards expired no longer appear in the same review round siyuan-note#10087 🎨 https://ld246.com/article/1704285860053/comment/1704528635155#comments 🐛 fix siyuan-note#10088 🎨 https://ld246.com/article/1704285860053 🎨 fix siyuan-note#10086 🎨 fix siyuan-note#10085 🎨 fix siyuan-note#10048 🎨 Add internal kernel API `/api/filetree/upsertIndexes` and `/api/filetree/removeIndexes` siyuan-note#10079 🎨 fix siyuan-note#10083 ⬆️ Upgrade kernel deps ⬆️ Upgrade kernel deps 🎨 fix siyuan-note#10000 🎨 siyuan-note#10065 ... # Conflicts: # app/src/util/needSubscribe.ts # kernel/model/conf.go
这个数据已经是查询出来的了,如果需要等待其他查询的话可能无法使用 event bus,需要重新设计。 目前的数据是通过 "/api/riff/getRiffDueCards","/api/riff/getTreeRiffDueCards" 和 "/api/riff/getNotebookRiffDueCards" 接口传出来的。你是需要基于这些数据进行修改,还是数据也自己查询? |
感谢回复。 我也是使用 *DueCards 接口查询。 如果可以简单修改Plugin,给Plugin加个排序函数字段
原来发事件的几个地方大概改一下:
这样会有多个插件互相排斥的问题。但这样比较简单。以后可以设计更好的方案。比较两个插件都注册了要排序,那得有地方看到目前用的哪个插件的。 |
这样所有插件都会执行,只能靠用户自己选择插件了。 |
@Vanessa219 嗯,目前这种写法,还得靠插件提供开关,让用户自己选择。 |
update-cards
updateCards
In what scenarios do you need this feature?
希望openTab, card类型可以接受插件提供的ids,并且按照提供是顺序展示闪卡。
有时希望能够对闪卡排序做优先级。
乱序:一起制的卡,不要一起复习,上一个闪卡可能带有下一个闪卡的答案。
Describe the optimal solution
希望openTab, card类型可以接受插件提供的ids。
Describe the candidate solution
No response
Other information
No response
The text was updated successfully, but these errors were encountered: