mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-20 09:06:36 +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'];
|
cardType = json['card_type'];
|
||||||
adInfo = json['ad_info'];
|
adInfo = json['ad_info'];
|
||||||
threePoint = json['three_point'] != null
|
threePoint = json['three_point_v2'] != null
|
||||||
? ThreePoint.fromJson(json['three_point'])
|
? ThreePoint.fromJson(json['three_point_v2'])
|
||||||
: null;
|
: null;
|
||||||
desc = json['desc'];
|
desc = json['desc'];
|
||||||
}
|
}
|
||||||
@@ -94,15 +94,26 @@ class RcmdOwner extends BaseOwner {
|
|||||||
class ThreePoint {
|
class ThreePoint {
|
||||||
List<Reason>? dislikeReasons;
|
List<Reason>? dislikeReasons;
|
||||||
List<Reason>? feedbacks;
|
List<Reason>? feedbacks;
|
||||||
int? watchLater;
|
// int? watchLater;
|
||||||
|
|
||||||
ThreePoint.fromJson(Map<String, dynamic> json) {
|
ThreePoint.fromJson(List json) {
|
||||||
dislikeReasons = (json['dislike_reasons'] as List?)
|
for (var elem in json) {
|
||||||
?.map((v) => Reason.fromJson(v))
|
switch (elem['type']) {
|
||||||
.toList();
|
// case 'watch_later':
|
||||||
feedbacks =
|
// watchLater = 1;
|
||||||
(json['feedbacks'] as List?)?.map((v) => Reason.fromJson(v)).toList();
|
// break;
|
||||||
watchLater = json['watch_later'];
|
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