Skip to content

Commit

Permalink
fix: 番剧信息容错
Browse files Browse the repository at this point in the history
  • Loading branch information
orz12 committed Mar 22, 2024
1 parent f67e90e commit fa1de0e
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions lib/models/bangumi/info.dart
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ class BangumiInfoModel {
title = json['title'];
total = json['total'];
type = json['type'];
userStatus = UserStatus.fromJson(json['user_status']);
if (json['user_status'] != null) {
userStatus = UserStatus.fromJson(json['user_status']);
}
staff = json['staff'];
}
}
Expand Down Expand Up @@ -218,6 +220,7 @@ class EpisodeItem {
vid = json['vid'];
}
}

class UserStatus {
UserStatus({
this.areaLimit,
Expand Down Expand Up @@ -249,11 +252,16 @@ class UserStatus {
login = json['login'];
pay = json['pay'];
payPackPaid = json['pay_pack_paid'];
progress = UserProgress.fromJson(json['progress']);
if (json['progress'] != null) {
progress = UserProgress.fromJson(json['progress']);
}
sponsor = json['sponsor'];
vipInfo = VipInfo.fromJson(json['vip_info']);
if (json['vip_info'] != null) {
vipInfo = VipInfo.fromJson(json['vip_info']);
}
}
}

class UserProgress {
UserProgress({
this.lastEpId,
Expand All @@ -269,6 +277,7 @@ class UserProgress {
lastTime = json['last_time'];
}
}

class VipInfo {
VipInfo({
this.dueDate,
Expand All @@ -283,4 +292,4 @@ class VipInfo {
status = json['status'];
type = json['type'];
}
}
}

0 comments on commit fa1de0e

Please sign in to comment.