diff --git a/lib/pages/player/player_logic.dart b/lib/pages/player/player_logic.dart index 4685810..c20607a 100644 --- a/lib/pages/player/player_logic.dart +++ b/lib/pages/player/player_logic.dart @@ -173,6 +173,8 @@ class PlayerLogic extends ChangeNotifier { /// 推荐页每页一个 logic,若只保留最后一次注册的 handler, /// 相邻预加载页会盖掉正在播放页的注册,导致小窗 UI 不隐藏且无声音。 static final Set _pipSubscribers = {}; + /// 「记住上次选集」:dramaId → 集号。只在用户从选集面板主动挑集时写入 + /// (见 [_recordPickedEpisode]),feed 里同一部剧据此显示上次选中的集。 static final Map pickedEpisode = {}; final Set _unlockedEpisodeIds = {}; final Map _episodeStats = {}; @@ -1608,6 +1610,7 @@ class PlayerLogic extends ChangeNotifier { _pendingSelectionIndex = null; _pendingSelectionRevision = null; await selectEpisode(index, revision: revision); + _recordPickedEpisode(index); } } finally { _selectionDrain = null; @@ -1620,6 +1623,18 @@ class PlayerLogic extends ChangeNotifier { } } + /// 记录用户从选集面板主动挑的集,供 feed 侧「记住上次选集」展示。 + /// 只在切集确实落到该集时记录,避免快速连点时把没播过的集记成"上次选集"。 + void _recordPickedEpisode(int index) { + if (!_started || _disposed || session.currentIndex != index) return; + if (index < 0 || index >= sessionEpisodes.length) return; + final episode = sessionEpisodes[index]; + final dramaId = _dramaIdForEpisode(episode.id); + if (dramaId != null) { + pickedEpisode[dramaId] = episode.number; + } + } + Future selectEpisode( int index, { int? revision,