diff --git a/README.md b/README.md index b2aa603c..6b6ed159 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Miru App - [x] 扩展设置 - [x] 影视播放进度 - [x] 漫画小说设置 -- [ ] 漫画小说历史记录 +- [x] 漫画小说历史记录 - [ ] TMDB 元数据 - [ ] 字幕 - [ ] BT 种子播放 diff --git a/lib/pages/watch/widgets/reader/comic/controller.dart b/lib/pages/watch/widgets/reader/comic/controller.dart index c62b2b10..63713c48 100644 --- a/lib/pages/watch/widgets/reader/comic/controller.dart +++ b/lib/pages/watch/widgets/reader/comic/controller.dart @@ -58,7 +58,10 @@ class ComicController extends ReaderController { super.runtime.extension.package, super.detailUrl, ); - if (history == null) { + if (history == null || + history.progress.isEmpty || + episodeGroupId != history.episodeGroupId || + history.episodeId != index.value) { return; } currentPage.value = int.parse(history.progress); diff --git a/lib/pages/watch/widgets/reader/novel/controller.dart b/lib/pages/watch/widgets/reader/novel/controller.dart index 91ccab93..b90fcd9b 100644 --- a/lib/pages/watch/widgets/reader/novel/controller.dart +++ b/lib/pages/watch/widgets/reader/novel/controller.dart @@ -38,6 +38,10 @@ class NovelController extends ReaderController { fontSize, (callback) => MiruStorage.setSetting(SettingKey.novelFontSize, callback), ); + + // 切换章节时重置页码 + ever(index, (callback) => positions.value = 0); + ever(super.watchData, (callback) async { if (isRecover.value || callback == null) { return; @@ -48,7 +52,10 @@ class NovelController extends ReaderController { super.runtime.extension.package, super.detailUrl, ); - if (history == null) { + if (history == null || + history.progress.isEmpty || + episodeGroupId != history.episodeGroupId || + history.episodeId != index.value) { return; } positions.value = int.parse(history.progress); diff --git a/pubspec.yaml b/pubspec.yaml index 11e54015..ba576a31 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: miru_app description: A new Flutter project. publish_to: "none" -version: 1.5.1+16 +version: 1.5.2+17 environment: sdk: ">=3.0.3 <4.0.0"