Skip to content

Commit 69f0c48

Browse files
committed
Merge branch 'master' into release
2 parents 7117e94 + 0961b8c commit 69f0c48

File tree

4 files changed

+17
-10
lines changed

4 files changed

+17
-10
lines changed

RELEASE_NOTES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
- Fixed a critical error.
1+
- Don't immediately delete finished airing entry.

lib/src/components/animelist/animelist.controller.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,14 +344,14 @@ class AnimelistController extends MomentumController<AnimelistModel> {
344344

345345
final orderBy = filter.orderBy;
346346
if (orderBy == OrderBy.episodeRelease) {
347-
var withTimestamp = result.where((x) => x.hasEpisodeSchedule && x.status == 'Ongoing').toList();
348-
var withoutTimestamp = result.where((x) => !x.hasEpisodeSchedule && x.status == 'Ongoing').toList();
347+
var withTimestamp = result.where((x) => x.hasEpisodeSchedule && x.isOngoing).toList();
348+
var withoutTimestamp = result.where((x) => !x.hasEpisodeSchedule && x.isOngoing).toList();
349349
var upcoming = result.where((x) => x.status == 'Upcoming').toList();
350350
result = withTimestamp..addAll(withoutTimestamp)..addAll(upcoming);
351351
}
352352

353353
if (!filter.showOngoing) {
354-
result.removeWhere((x) => x.status == 'Ongoing');
354+
result.removeWhere((x) => x.isOngoing);
355355
}
356356
if (!filter.showUpcoming) {
357357
result.removeWhere((x) => x.status == 'Upcoming');

lib/src/core/services.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ var fcmService = FcmService();
77
List<MomentumService> services() {
88
return [
99
fcmService,
10-
// ApiService(),
11-
// GoogleApiService(),
12-
// MalService(),
13-
ApiMockService(),
14-
GoogleApiMockService(),
15-
MalMockService(),
10+
ApiService(),
11+
GoogleApiService(),
12+
MalService(),
13+
// ApiMockService(),
14+
// GoogleApiMockService(),
15+
// MalMockService(),
1616
];
1717
}

lib/src/data/response.all_anime.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class AnimeEntry {
5454
this.malFavorites = 0,
5555
this.season = '',
5656
this.livechartId = -1,
57+
this.markedForDeletion = false,
5758
this.displayTitle = '',
5859
this.orderLabel = '',
5960
this.following = false,
@@ -78,6 +79,7 @@ class AnimeEntry {
7879
final int malFavorites;
7980
final String season;
8081
final int livechartId;
82+
final bool markedForDeletion;
8183

8284
/* These props here are not part of JSON response. They're for UI */
8385
final String displayTitle;
@@ -97,6 +99,8 @@ class AnimeEntry {
9799
/// Use this for sorting only.
98100
int get episodeTimestamp => latestEpisodeTimestamp == 0 ? -1 : latestEpisodeTimestamp;
99101

102+
bool get isOngoing => status == 'Ongoing' || markedForDeletion;
103+
100104
AnimeEntry copyWith({
101105
String? slug,
102106
String? title,
@@ -115,6 +119,7 @@ class AnimeEntry {
115119
int? malFavorites,
116120
String? season,
117121
int? livechartId,
122+
bool? markedForDeletion,
118123
String? displayTitle,
119124
String? orderLabel,
120125
bool? following,
@@ -168,6 +173,7 @@ class AnimeEntry {
168173
malFavorites: json["mal_favorites"] == null ? 0 : json["mal_favorites"],
169174
season: json["season"] == null ? '' : json["season"],
170175
livechartId: json["livechart_id"] == null ? -1 : json["livechart_id"],
176+
markedForDeletion: json["marked_for_deletion"] == null ? false : json["marked_for_deletion"],
171177
);
172178

173179
Map<String, dynamic> toJson() => {
@@ -188,5 +194,6 @@ class AnimeEntry {
188194
"mal_favorites": malFavorites,
189195
"season": season,
190196
"livechart_id": livechartId,
197+
"marked_for_deletion": markedForDeletion,
191198
};
192199
}

0 commit comments

Comments
 (0)