mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
fix: reverse play
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -127,7 +127,6 @@ class _BangumiPanelState extends State<BangumiPanel> {
|
||||
widget.pages[currentIndex].bvid,
|
||||
widget.pages[currentIndex].aid,
|
||||
cid,
|
||||
null,
|
||||
),
|
||||
child: Text(
|
||||
widget.newEp?['desc']?.contains('连载') == true
|
||||
|
||||
@@ -102,7 +102,6 @@ class _PagesPanelState extends State<PagesPanel> {
|
||||
widget.bvid,
|
||||
IdUtils.bv2av(widget.bvid),
|
||||
cid,
|
||||
null,
|
||||
),
|
||||
child: Text(
|
||||
'共${widget.pages.length}集',
|
||||
|
||||
@@ -29,7 +29,7 @@ class SeasonPanel extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _SeasonPanelState extends State<SeasonPanel> {
|
||||
int currentIndex = 0;
|
||||
RxInt currentIndex = 0.obs;
|
||||
late VideoDetailController _videoDetailController;
|
||||
StreamSubscription? _listener;
|
||||
List<EpisodeItem> episodes = <EpisodeItem>[];
|
||||
@@ -52,7 +52,7 @@ class _SeasonPanelState extends State<SeasonPanel> {
|
||||
// episodes = widget.ugcSeason.sections!
|
||||
// .firstWhere((e) => e.seasonId == widget.ugcSeason.id)
|
||||
// .episodes;
|
||||
currentIndex = episodes.indexWhere(
|
||||
currentIndex.value = episodes.indexWhere(
|
||||
(EpisodeItem e) => e.cid == _videoDetailController.seasonCid);
|
||||
_listener = _videoDetailController.cid.listen((int p0) {
|
||||
if (widget.pages != null && widget.pages!.length != 1) {
|
||||
@@ -61,10 +61,9 @@ class _SeasonPanelState extends State<SeasonPanel> {
|
||||
}
|
||||
_videoDetailController.seasonCid = p0;
|
||||
_findEpisode();
|
||||
currentIndex = episodes.indexWhere(
|
||||
currentIndex.value = episodes.indexWhere(
|
||||
(EpisodeItem e) => e.cid == _videoDetailController.seasonCid);
|
||||
if (!mounted) return;
|
||||
setState(() {});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -112,11 +111,6 @@ class _SeasonPanelState extends State<SeasonPanel> {
|
||||
_videoDetailController.bvid,
|
||||
null,
|
||||
_videoDetailController.seasonCid,
|
||||
() {
|
||||
setState(() {
|
||||
currentIndex = episodes.length - 1 - currentIndex;
|
||||
});
|
||||
},
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(8, 12, 8, 12),
|
||||
@@ -137,11 +131,13 @@ class _SeasonPanelState extends State<SeasonPanel> {
|
||||
semanticLabel: "正在播放:",
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Text(
|
||||
'${currentIndex + 1}/${episodes.length}',
|
||||
style: Theme.of(context).textTheme.labelMedium,
|
||||
semanticsLabel:
|
||||
'第${currentIndex + 1}集,共${episodes.length}集',
|
||||
Obx(
|
||||
() => Text(
|
||||
'${currentIndex.value + 1}/${episodes.length}',
|
||||
style: Theme.of(context).textTheme.labelMedium,
|
||||
semanticsLabel:
|
||||
'第${currentIndex.value + 1}集,共${episodes.length}集',
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
const Icon(
|
||||
|
||||
@@ -1577,7 +1577,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
);
|
||||
}
|
||||
|
||||
showEpisodes(index, season, episodes, bvid, aid, cid, onReverse) {
|
||||
showEpisodes(index, season, episodes, bvid, aid, cid) {
|
||||
Widget listSheetContent() => ListSheetContent(
|
||||
index: index,
|
||||
season: season,
|
||||
@@ -1600,7 +1600,6 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
onReverse: () {
|
||||
Get.back();
|
||||
onReversePlay();
|
||||
onReverse();
|
||||
},
|
||||
);
|
||||
if (isFullScreen) {
|
||||
|
||||
Reference in New Issue
Block a user