mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-01 00:28:18 +08:00
fix play next audio
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -298,13 +298,13 @@ class AudioController extends GetxController
|
|||||||
case PlayRepeat.pause:
|
case PlayRepeat.pause:
|
||||||
break;
|
break;
|
||||||
case PlayRepeat.listOrder:
|
case PlayRepeat.listOrder:
|
||||||
playNext();
|
playNext(nextPart: true);
|
||||||
break;
|
break;
|
||||||
case PlayRepeat.singleCycle:
|
case PlayRepeat.singleCycle:
|
||||||
_replay();
|
_replay();
|
||||||
break;
|
break;
|
||||||
case PlayRepeat.listCycle:
|
case PlayRepeat.listCycle:
|
||||||
if (!playNext()) {
|
if (!playNext(nextPart: true)) {
|
||||||
if (index != null && index != 0 && playlist != null) {
|
if (index != null && index != 0 && playlist != null) {
|
||||||
playIndex(0);
|
playIndex(0);
|
||||||
} else {
|
} else {
|
||||||
@@ -606,7 +606,27 @@ class AudioController extends GetxController
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool playNext() {
|
bool playNext({bool nextPart = false}) {
|
||||||
|
if (nextPart) {
|
||||||
|
if (audioItem.value case final audioItem?) {
|
||||||
|
final parts = audioItem.parts;
|
||||||
|
if (parts.length > 1) {
|
||||||
|
final subId = this.subId.firstOrNull;
|
||||||
|
final nextIndex = parts.indexWhere((e) => e.subId == subId) + 1;
|
||||||
|
if (nextIndex != 0 && nextIndex < parts.length) {
|
||||||
|
final nextPart = parts[nextIndex];
|
||||||
|
oid = nextPart.oid;
|
||||||
|
this.subId = [nextPart.subId];
|
||||||
|
_queryPlayUrl().then((res) {
|
||||||
|
if (res) {
|
||||||
|
_videoDetailController = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (index != null && playlist != null && player != null) {
|
if (index != null && playlist != null && player != null) {
|
||||||
final next = index! + 1;
|
final next = index! + 1;
|
||||||
if (next < playlist!.length) {
|
if (next < playlist!.length) {
|
||||||
|
|||||||
Reference in New Issue
Block a user