mod: segment data type

This commit is contained in:
guozhigq
2024-11-09 01:34:10 +08:00
parent b85c33bcde
commit 32923cd417
4 changed files with 5 additions and 4 deletions

View File

@ -16,7 +16,7 @@ extension ActionTypeExtension on ActionType {
'chapter', 'chapter',
][index]; ][index];
String get name => [ String get label => [
'跳过', '跳过',
'静音', '静音',
'完整观看', '完整观看',

View File

@ -6,7 +6,7 @@ class SegmentDataModel {
final ActionType? actionType; final ActionType? actionType;
final List? segment; final List? segment;
final String? uuid; final String? uuid;
final double? videoDuration; final num? videoDuration;
final int? locked; final int? locked;
final int? votes; final int? votes;
final String? description; final String? description;

View File

@ -30,7 +30,7 @@ extension SegmentTypeExtension on SegmentType {
'chapter', 'chapter',
][index]; ][index];
String get name => [ String get label => [
'赞助', '赞助',
'开场介绍', '开场介绍',
'片尾致谢', '片尾致谢',

View File

@ -13,6 +13,7 @@ import 'package:pilipala/http/video.dart';
import 'package:pilipala/models/common/reply_type.dart'; import 'package:pilipala/models/common/reply_type.dart';
import 'package:pilipala/models/common/search_type.dart'; import 'package:pilipala/models/common/search_type.dart';
import 'package:pilipala/models/sponsor_block/segment.dart'; import 'package:pilipala/models/sponsor_block/segment.dart';
import 'package:pilipala/models/sponsor_block/segment_type.dart';
import 'package:pilipala/models/video/later.dart'; import 'package:pilipala/models/video/later.dart';
import 'package:pilipala/models/video/play/quality.dart'; import 'package:pilipala/models/video/play/quality.dart';
import 'package:pilipala/models/video/play/url.dart'; import 'package:pilipala/models/video/play/url.dart';
@ -754,7 +755,7 @@ class VideoDetailController extends GetxController
await plPlayerController.videoPlayerController await plPlayerController.videoPlayerController
?.seek(Duration(seconds: segmentEnd)); ?.seek(Duration(seconds: segmentEnd));
segment.isSkip = true; segment.isSkip = true;
SmartDialog.showToast('已跳过${segment.category!.name}片段'); SmartDialog.showToast('已跳过${segment.category!.label}片段');
} }
} catch (err) { } catch (err) {
SmartDialog.showToast('skipSegments error: $err'); SmartDialog.showToast('skipSegments error: $err');