opt: manul skip

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-01-04 16:04:37 +08:00
parent be42ce97f8
commit 8186307f98

View File

@@ -724,7 +724,7 @@ class VideoDetailController extends GetxController
SmartDialog.showToast( SmartDialog.showToast(
msg, msg,
alignment: alignment:
plPlayerController.isFullScreen.value ? Alignment(-0.9, 0.5) : null, plPlayerController.isFullScreen.value ? Alignment(0, 0.7) : null,
); );
} }
@@ -789,7 +789,6 @@ class VideoDetailController extends GetxController
second: _convert(item['segment'][1]), second: _convert(item['segment'][1]),
), ),
skipType: skipType, skipType: skipType,
hasSkipped: false,
); );
}, },
).toList()); ).toList());
@@ -838,8 +837,7 @@ class VideoDetailController extends GetxController
} else if (item.skipType == SkipType.skipManually) { } else if (item.skipType == SkipType.skipManually) {
listData.insert(0, item); listData.insert(0, item);
listKey.currentState?.insertItem(0); listKey.currentState?.insertItem(0);
skipTimer ??= skipTimer ??= Timer.periodic(const Duration(seconds: 3), (_) {
Timer.periodic(const Duration(milliseconds: 2500), (_) {
if (listData.isNotEmpty) { if (listData.isNotEmpty) {
onRemoveItem(listData.length - 1, listData.last); onRemoveItem(listData.length - 1, listData.last);
} else { } else {
@@ -857,7 +855,8 @@ class VideoDetailController extends GetxController
} }
void onRemoveItem(int index, SegmentModel item) { void onRemoveItem(int index, SegmentModel item) {
EasyThrottle.throttle('onRemoveItem', const Duration(seconds: 1), () { EasyThrottle.throttle('onRemoveItem', const Duration(milliseconds: 500),
() {
try { try {
listData.removeAt(index); listData.removeAt(index);
listKey.currentState?.removeItem( listKey.currentState?.removeItem(
@@ -881,10 +880,11 @@ class VideoDetailController extends GetxController
child: SearchText( child: SearchText(
bgColor: Theme.of(Get.context!) bgColor: Theme.of(Get.context!)
.colorScheme .colorScheme
.onInverseSurface .secondaryContainer
.withOpacity(0.7), .withOpacity(0.8),
textColor: Theme.of(Get.context!).colorScheme.onSecondaryContainer,
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
fontSize: 13, fontSize: 14,
text: '跳过: ${item.segmentType.shortTitle}', text: '跳过: ${item.segmentType.shortTitle}',
onTap: (_) { onTap: (_) {
onSkip(item); onSkip(item);