添加三个实用功能#2174
Open
ZHwash wants to merge 13 commits into
Open
Conversation
…Bangumi Mirror to official v2.1.3 base
…isodes; add airTime field
…ith parallel batch requests
Author
|
存在一个小bug:时间线卡片显示播出集数在每次完全重新打开此程序(后台完全关闭)时需要重新加载,一般在10s左右。此bug我暂时无法处理。 |
Owner
|
感谢你的工作,但是此实现目前无法接受 我们不能改变 Bangumi API 的行为,在 Bangumi API 的榜单与时间表API没有提供放送进度的情况下,我们应该倾向于不实现此功能,而不是为每个动画进行单独的详情请求,来让一个页面的网络请求数放大几十倍,这也是重新加载要 10s 的原因 |
Author
|
请问后续的更新提醒功能将如何实现?
|
Owner
|
在 Bangumi 提供相关接口前,这些功能无法推进,当前为每个番剧单独请求一次详情的做法是不可接受的 |
Author
|
好的。请问是否需要单独添加功能一:'长按或右键可直接呼出分类页面',亦或类似功能性开发已在计划中?如可行,我可以提交此单独功能的pr
|
Owner
|
功能一暂时没有相关计划,自定义收藏分类不在当前计划中 因为当前五种分类是在和 Bangumi 官方保持一致 |
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.
Kazumi 新增功能Changelog
注意:使用了AI辅助编程技术
新增功能
功能一:番剧卡片长按/右键收藏菜单
目标
在热门、时间线、搜索、收藏页面上,长按或右键点击番剧卡片时弹出「添加到分类」菜单,允许用户快速将番剧加入已创建的自定义收藏分类。
改动文件
lib/bean/widget/collect_button.dartmenuController/iconSize/constraints/padding参数;switch→map 重构lib/bean/widget/collectable_card_wrapper.dart(新)StatefulWidget,包裹任意卡片,提供MenuController+GestureDetector+CollectButton叠加层lib/bean/card/bangumi_card.dartonLongPress/onSecondaryTap回调lib/bean/card/bangumi_timeline_card.dartonLongPress/onSecondaryTap回调lib/pages/collect/collect_page.dartCollectButton;编辑模式 = 40px 圆形,普通模式 = 32px 半透明圆形lib/pages/popular/popular_page.dartCollectableCardWrapper包裹BangumiCardVlib/pages/timeline/timeline_page.dartCollectableCardWrapper包裹BangumiTimelineCardlib/pages/search/search_page.dartCollectableCardWrapper包裹BangumiCardV设计要点
CollectableCardWrapper始终渲染GestureDetector+CollectButton在Stack中right: 4, bottom: 8(32×32 半透明圆形)BackdropFilter(Windows 渲染兼容性)MenuController.open(),复用原有的分类菜单逻辑功能二:收藏页更新角标
目标
在收藏页(追踪中)的番剧卡片上显示红色角标,提示该番剧有未观看的新剧集。
改动文件
lib/utils/update_check_service.dart(新)UpdateCheckService— 遍历「在看」列表,调用 Bangumi API 获取最新集数,与已记录集数比较lib/pages/collect/collect_controller.dartObservableSet<int> bangumiIdsWithUpdate;@action checkForUpdates()含 20s 超时;loadCollectibles()中延迟调用lib/pages/collect/collect_page.dartlib/modules/collect/collect_module.dartCollectedBangumi新增eps字段 (@HiveField(3)),记录总集数lib/repositories/collect_crud_repository.dartupdateCollectibleEps(id, eps)方法,更新收藏番剧的集数信息设计要点
BangumiApi.getBangumiEpisodesByID()(type=0 的剧集数)而非每插件查询_crudRepo避免 DI 死锁功能三:时间线卡片显示播出集数
目标
在时间线页面的每张番剧卡片上显示最新已播集数(更新至第X话),并支持按播出日期排序。
改动文件
lib/bean/card/bangumi_timeline_card.dartepisodeCount/onLongPress/onSecondaryTap参数;底部显示 ▶ 更新至第X话;GestureDetector包裹InkWell支持长按/右键lib/pages/timeline/timeline_controller.dartObservableMap<int, int> episodeCounts+isLoadingEpisodes+fetchEpisodeCounts()异步并行加载;changeSortType()新增第 4 种排序(按 airDate)lib/pages/timeline/timeline_controller.g.dartlib/pages/timeline/timeline_page.dartepisodeCounts[item.id]传入BangumiTimelineCardlib/modules/bangumi/bangumi_item.dartairTime字段 (@HiveField(15));fromJson中解析airtime.timelib/modules/bangumi/bangumi_item.g.dartlib/modules/bangumi/episode_item.dartairdate/status字段 +isAired计算属性,判断剧集是否已播出调用时机
getSchedules()(当前季度)/getSchedulesBySeason()(历史季度)完成后自动触发fetchEpisodeCounts()BangumiApi.getBangumiEpisodesByID()isAired == true),取最大集数性能优化
isAired == true的集数,排除未播出和特别篇功能回退
以下功能已在开发过程中被移除或简化:
回退一:移除时间线卡片中的星期和具体时间显示
原因
移除内容
当前时间线卡片底部显示