feat: part: reverse play #70

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2024-12-31 12:25:45 +08:00
parent 1215d126cc
commit de3edcfa13
7 changed files with 144 additions and 99 deletions

View File

@@ -55,10 +55,15 @@ class _SeasonPanelState extends State<SeasonPanel> {
currentIndex.value = episodes.indexWhere(
(EpisodeItem e) => e.cid == _videoDetailController.seasonCid);
_listener = _videoDetailController.cid.listen((int cid) {
if (widget.pages != null && widget.pages!.length != 1) {
bool isPart = widget.pages?.indexWhere((item) => item.cid == cid) != -1;
if (isPart) return;
if (_videoDetailController.seasonCid == cid) {
//refresh
_findEpisode();
currentIndex.value = episodes.indexWhere(
(EpisodeItem e) => e.cid == _videoDetailController.seasonCid);
return;
}
bool isPart = widget.pages?.indexWhere((item) => item.cid == cid) != -1;
if (isPart) return;
_videoDetailController.seasonCid = cid;
_findEpisode();
currentIndex.value = episodes.indexWhere(