Skip to content
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

feat(web): favorites support local fiction #89

Merged
merged 6 commits into from
Jun 22, 2024

Conversation

153264
Copy link
Contributor

@153264 153264 commented Jun 20, 2024

浏览器 indexdb volumes
新增 favorite 表 表字段 id: string, title: string
修改 metadata 表 新增 favoriteId: string

页面优化
我的收藏:本地小说 /favorite/local/default
支持管理标签,批量对文章分类

Sakura工作区 /workspace/sakura
本地小说 支持管理标签,批量对文章分类

#87

此issuse提到工作区需要全面升级,此pr暂时不调整工作区页面
#88 (comment)

@FishHawk
Copy link
Owner

这两天有点事,明天晚上我看看

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

用Promise.all有潜在的隐患,而且Indexeddb似乎不支持并发写操作,因此速度可能区别不大。等下我改成普通循环,以后有需要再优化吧。

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

收藏夹本身是有限的,没必要塞进indexeddb里面,等下我会移动到localstorage里面。

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

稍微牵扯的有点太多了,想一步到位缓存web/wenku收藏夹的话,得在数据层区分下dataSource和repository,明天接着做。

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里我打算直接在indexeddb版本号升级里面批量编辑,就不用留下负债了。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const createMetadata = (value: LocalVolumeMetadata) =>

那对应创建metadata的时候也要加一个默认的favoriteId

@FishHawk FishHawk force-pushed the favorites_support_local_fiction branch from eb49966 to 2345907 Compare June 21, 2024 17:56
@FishHawk
Copy link
Owner

搞定了,顺便把本地缓存收藏夹也一起做了,有空测试下吗?
没时间的话我过会直接merge了。

@FishHawk FishHawk merged commit 0a551ed into FishHawk:main Jun 22, 2024
@FishHawk
Copy link
Owner

啊,想起来了。
因为最终tag表得存到服务器那边,要是懒得返工的话,我先加接口?
另外tag id我想了想,会让过滤/搜索变得有点难搞,而且如果还用uuid的话,会让tag数组增大很多倍,有点头疼。

@153264
Copy link
Contributor Author

153264 commented Jun 22, 2024

另外tag id我想了想,会让过滤/搜索变得有点难搞,而且如果还用uuid的话,会让tag数组增大很多倍,有点头疼。

我建议是直接多对多的关系,加一张中间表
这样方便搜索

@FishHawk
Copy link
Owner

我建议是直接多对多的关系,加一张中间表

你意思的tag表和tag-小说关系表?不会方便的。现在搜索两个方案,一是把tag数组塞进es里面,二是使用mongodb自带的全文搜索,不管哪个都比中间表方便,但都需要标签字面量。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants