Skip to content

Commit

Permalink
Fixed issue #4
Browse files Browse the repository at this point in the history
  • Loading branch information
vinayak5002 committed Aug 28, 2022
1 parent 101ad7a commit fdd0dbd
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions lib/Models/Show.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import './StatusEnum.dart';

const String defaultImage = "Hello";

class Show{
int malId;
int epsCompleted;
Expand All @@ -16,20 +14,10 @@ class Show{
required this.title,
required this.epsCompleted,
required this.epsTotal,
this.status = ShowStatus.planned,
required this.status,
required this.imageURL,
required this.airStatus
}){
if(epsCompleted == epsTotal){
status = ShowStatus.completed;
}
else if(epsCompleted > 0){
status = ShowStatus.watching;
}
else{
status = ShowStatus.planned;
}
}
});

int getEpsCompleted(){
return epsCompleted;
Expand All @@ -48,7 +36,7 @@ class Show{
epsCompleted: jsonData['epsCompleted'],
epsTotal: jsonData['epsTotal'],
status: ShowStatus.values[jsonData['status']],
imageURL: jsonData['imageURL'] ?? defaultImage,
imageURL: jsonData['imageURL'],
airStatus: AirStatus.values[jsonData['airStatus']]
);
}
Expand Down

0 comments on commit fdd0dbd

Please sign in to comment.