mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
feat: pgc skip
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -10,11 +10,10 @@ class SegmentModel {
|
||||
required this.segmentType,
|
||||
required this.segment,
|
||||
required this.skipType,
|
||||
this.hasSkipped = false,
|
||||
});
|
||||
String UUID;
|
||||
SegmentType segmentType;
|
||||
Pair<int, int> segment;
|
||||
SkipType skipType;
|
||||
bool hasSkipped;
|
||||
late bool hasSkipped = false;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'dart:math' show max, min;
|
||||
|
||||
import 'package:PiliPlus/models/common/video/audio_quality.dart';
|
||||
import 'package:PiliPlus/models/common/video/video_quality.dart';
|
||||
import 'package:PiliPlus/models_new/sponsor_block/segment_item.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
|
||||
class PlayUrlModel {
|
||||
@@ -44,6 +45,7 @@ class PlayUrlModel {
|
||||
int? lastPlayCid;
|
||||
String? curLanguage;
|
||||
Language? language;
|
||||
List<SegmentItemModel>? clipInfoList;
|
||||
|
||||
PlayUrlModel.fromJson(Map<String, dynamic> json) {
|
||||
from = json['from'];
|
||||
@@ -72,6 +74,25 @@ class PlayUrlModel {
|
||||
language = json['language'] == null
|
||||
? null
|
||||
: Language.fromJson(json['language']);
|
||||
// debug
|
||||
// final clipInfoList = [
|
||||
// {
|
||||
// "start": 0,
|
||||
// "end": 150,
|
||||
// "clipType": "CLIP_TYPE_OP",
|
||||
// },
|
||||
// {
|
||||
// "start": timeLength! ~/ 1000 - 150,
|
||||
// "end": timeLength! ~/ 1000,
|
||||
// "clipType": "CLIP_TYPE_ED",
|
||||
// },
|
||||
// ];
|
||||
final List? clipInfoList = json['clip_info_list'];
|
||||
if (clipInfoList != null && clipInfoList.isNotEmpty) {
|
||||
this.clipInfoList = clipInfoList
|
||||
.map((e) => SegmentItemModel.fromPgcJson(e, timeLength))
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user