File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ class _ActivityPageState extends ConsumerState<ActivityPage>
143
143
children: [
144
144
Text ("开始时间:${timeago .format (ac .date !)}" ),
145
145
Text ("大小:${(ac .size ?? 0 ).readableFileSize ()}" ),
146
- ac.seedRatio > 0
146
+ ( ac.seedRatio?? 0 ) > 0
147
147
? Text ("分享率:${ac .seedRatio }" )
148
148
: SizedBox ()
149
149
],
Original file line number Diff line number Diff line change @@ -110,23 +110,23 @@ class Activity {
110
110
final String ? saved;
111
111
final int ? progress;
112
112
final int ? size;
113
- final double seedRatio;
114
- final double uploadProgress;
113
+ final double ? seedRatio;
114
+ final double ? uploadProgress;
115
115
116
116
factory Activity .fromJson (Map <String , dynamic > json) {
117
117
return Activity (
118
118
id: json["id" ],
119
119
mediaId: json["media_id" ],
120
120
episodeId: json["episode_id" ],
121
121
sourceTitle: json["source_title" ],
122
- date: DateTime .tryParse (json["date" ] ?? "" ),
122
+ date: DateTime .tryParse (json["date" ] ?? DateTime . now (). toString () ),
123
123
targetDir: json["target_dir" ],
124
124
status: json["status" ],
125
125
saved: json["saved" ],
126
- progress: json["progress" ],
127
- seedRatio: json["seed_ratio" ],
128
- size: json["size" ],
129
- uploadProgress: json["upload_progress" ]);
126
+ progress: json["progress" ]?? 0 ,
127
+ seedRatio: json["seed_ratio" ]?? 0 ,
128
+ size: json["size" ]?? 0 ,
129
+ uploadProgress: json["upload_progress" ]?? 0 );
130
130
}
131
131
}
132
132
You can’t perform that action at this time.
0 commit comments