Skip to content

基于自定义规则的番剧采集APP,支持流媒体在线观看,支持弹幕,支持实时超分辨率。

fix(player): keep episode comments when reparsing the same episode

Prediditb4cdfce18495
diff --git a/lib/pages/video/video_controller.dart b/lib/pages/video/video_controller.dart
index 2fafa01f..c1594907 100644
--- a/lib/pages/video/video_controller.dart
+++ b/lib/pages/video/video_controller.dart
@@ -382,10 +382,16 @@ abstract class _VideoPageController with Store implements Disposable {
/// notification instead of one per field.
@action
void _beginEpisodeSwitch(VideoEpisodeSelection selection) {
+ final targetCommentsEpisode = commentEpisodeForSelection(selection);
selectedEpisode = selection;
playingEpisode = null;
- commentsEpisode = commentEpisodeForSelection(selection);
- _resetEpisodeComments();
+ // The comments sheet only re-queries when [commentsEpisode] changes, so
+ // resetting comment state here without changing it would blank the sheet
+ // permanently.
+ if (targetCommentsEpisode != commentsEpisode) {
+ commentsEpisode = targetCommentsEpisode;
+ _resetEpisodeComments();
+ }
_loading = true;
_errorMessage = null;
}