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

Add episodeName to hive to display it in history card #323

Merged
merged 5 commits into from
Oct 19, 2024

Conversation

ErBWs
Copy link
Contributor

@ErBWs ErBWs commented Oct 19, 2024

  1. 新旧版本hive结构互相兼容,新版本在旧版本上显示第几话,旧版本在新版本上显示相同,点开播放后恢复原始网页表现形式。

  2. 增加允许macOS播放http视频源设置,iOS已经允许不需要做改动

@Predidit
Copy link
Owner

感谢你的工作,不过这个PR会导致一些问题。

.g.dart 文件主要是模板代码,应该从对应的 .dart 文件根据注解自动生成,而不是自行修改。

在修改完对应的 .dart 文件后在终端运行 dart run build_runner build 以执行自动生成。

这个PR修改了自动生成的代码,后导致后续的自动生成出现问题。这里的最佳实践是,因为我们需要自定义 HistoryAdapter 。故此类不再适合自动生成,我们需要将对应的 HistoryAdapter 类从 .g.dart 中移动到 .dart 中,并移除 .dart 中Hisotry类的 @HiveType 注解以防止自动生成新的 HistoryAdapter 。

听上去似乎有些复杂? 如果觉得有些混乱的话,这个修改可以后续由我来进行。

@ErBWs ErBWs marked this pull request as draft October 19, 2024 10:19
@ErBWs
Copy link
Contributor Author

ErBWs commented Oct 19, 2024

就像我最新提交的这样吗?现在的.g.dart都是由dart run build_runner build生成的

另外给macOS增加了允许播放http视频源的设置,避免部分视频无法在macOS上播放

@Predidit
Copy link
Owner

看上去没有太大的问题,不过要通过运行过 dart run build_runner build 来修改 .g.dart 而不是手动移除对应代码。

这样可以确定当前修改没有损坏代码生成器。

@ErBWs ErBWs marked this pull request as ready for review October 19, 2024 10:28
@Predidit
Copy link
Owner

此外我们可以修改一下 history_page 来让 episodeName 为空时以以前的格式显示进度,而不是留空

@ErBWs ErBWs marked this pull request as draft October 19, 2024 10:29
@ErBWs
Copy link
Contributor Author

ErBWs commented Oct 19, 2024

的确

@ErBWs ErBWs marked this pull request as ready for review October 19, 2024 10:54
@Predidit Predidit merged commit b52ba49 into Predidit:main Oct 19, 2024
5 checks passed
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