mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
fix: three point (#792)
This commit is contained in:
committed by
GitHub
parent
0b05edd6ff
commit
56491591ab
@@ -47,8 +47,8 @@ class RecVideoItemAppModel extends BaseRecVideoItemModel {
|
||||
|
||||
cardType = json['card_type'];
|
||||
adInfo = json['ad_info'];
|
||||
threePoint = json['three_point'] != null
|
||||
? ThreePoint.fromJson(json['three_point'])
|
||||
threePoint = json['three_point_v2'] != null
|
||||
? ThreePoint.fromJson(json['three_point_v2'])
|
||||
: null;
|
||||
desc = json['desc'];
|
||||
}
|
||||
@@ -94,15 +94,26 @@ class RcmdOwner extends BaseOwner {
|
||||
class ThreePoint {
|
||||
List<Reason>? dislikeReasons;
|
||||
List<Reason>? feedbacks;
|
||||
int? watchLater;
|
||||
// int? watchLater;
|
||||
|
||||
ThreePoint.fromJson(Map<String, dynamic> json) {
|
||||
dislikeReasons = (json['dislike_reasons'] as List?)
|
||||
?.map((v) => Reason.fromJson(v))
|
||||
.toList();
|
||||
feedbacks =
|
||||
(json['feedbacks'] as List?)?.map((v) => Reason.fromJson(v)).toList();
|
||||
watchLater = json['watch_later'];
|
||||
ThreePoint.fromJson(List json) {
|
||||
for (var elem in json) {
|
||||
switch (elem['type']) {
|
||||
// case 'watch_later':
|
||||
// watchLater = 1;
|
||||
// break;
|
||||
case 'feedback':
|
||||
feedbacks = (elem['reasons'] as List?)
|
||||
?.map((i) => Reason.fromJson(i))
|
||||
.toList();
|
||||
break;
|
||||
case 'dislike':
|
||||
dislikeReasons = (elem['reasons'] as List?)
|
||||
?.map((i) => Reason.fromJson(i))
|
||||
.toList();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user