mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-15 22:56:15 +08:00
fix: rcmd data parse
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -12,20 +12,14 @@ class RecVideoItemAppModel extends BaseRecVideoItemModel {
|
|||||||
ThreePoint? threePoint;
|
ThreePoint? threePoint;
|
||||||
|
|
||||||
RecVideoItemAppModel.fromJson(Map<String, dynamic> json) {
|
RecVideoItemAppModel.fromJson(Map<String, dynamic> json) {
|
||||||
id = json['player_args'] != null
|
id = json['player_args']?['aid'] ?? int.tryParse(json['param'] ?? '0');
|
||||||
? json['player_args']['aid']
|
|
||||||
: int.tryParse(json['param'] ?? '-1');
|
|
||||||
aid = id;
|
aid = id;
|
||||||
bvid = json['bvid'] ??
|
bvid = json['bvid'] ?? IdUtils.av2bv(id!);
|
||||||
(json['player_args'] != null
|
cid = json['player_args']?['cid'] ?? 0;
|
||||||
? IdUtils.av2bv(json['player_args']['aid'])
|
|
||||||
: '');
|
|
||||||
cid = json['player_args'] != null ? json['player_args']['cid'] : -1;
|
|
||||||
pic = json['cover'];
|
pic = json['cover'];
|
||||||
stat = RcmdStat.fromJson(json);
|
stat = RcmdStat.fromJson(json);
|
||||||
// 改用player_args中的duration作为原始数据(秒数)
|
// 改用player_args中的duration作为原始数据(秒数)
|
||||||
duration =
|
duration = json['player_args']?['duration'] ?? 0;
|
||||||
json['player_args'] != null ? json['player_args']['duration'] : -1;
|
|
||||||
//duration = json['cover_right_text'];
|
//duration = json['cover_right_text'];
|
||||||
title = json['title'];
|
title = json['title'];
|
||||||
owner = RcmdOwner.fromJson(json);
|
owner = RcmdOwner.fromJson(json);
|
||||||
@@ -91,11 +85,9 @@ class RcmdStat implements BaseStat {
|
|||||||
class RcmdOwner extends BaseOwner {
|
class RcmdOwner extends BaseOwner {
|
||||||
RcmdOwner.fromJson(Map<String, dynamic> json) {
|
RcmdOwner.fromJson(Map<String, dynamic> json) {
|
||||||
name = json['goto'] == 'av'
|
name = json['goto'] == 'av'
|
||||||
? json['args']['up_name']
|
? (json['args']?['up_name'])
|
||||||
: json['desc_button'] != null
|
: (json['desc_button']?['text'] ?? '');
|
||||||
? json['desc_button']['text']
|
mid = json['args']?['up_id'] ?? 0;
|
||||||
: '';
|
|
||||||
mid = json['args']['up_id'] ?? -1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user