Skip to content
This repository has been archived by the owner on Jun 8, 2024. It is now read-only.

Commit

Permalink
🐛 fixed missing chapter
Browse files Browse the repository at this point in the history
  • Loading branch information
sou1maker committed May 31, 2022
1 parent 6c49d6d commit 92cc74c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/views/details.dart
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ class _DetailsState extends State<Details> {

/// 获取漫画章节
Future<List<ChapterDto>> _getMangaFeed() async {
_chapterListResponse ??= MangaApi.getMangaFeedAsync(widget.dto.id,
var response = await (_chapterListResponse ??= MangaApi.getMangaFeedAsync(widget.dto.id,
query: MangaFeedQuery(
limit: 96,
offset: 0,
Expand All @@ -260,16 +260,18 @@ class _DetailsState extends State<Details> {
ContentRating.pornographic
],
),
// 切勿 readableAt: OrderMode.desc, 否则缺少章节
order: MangaFeedOrder(
volume: OrderMode.desc,
chapter: OrderMode.desc,
readableAt: OrderMode.desc,
));
)));

var list = (await _chapterListResponse)!.data.map((e) => ChapterDto.fromSource(e)).toList();
var list = response.data.map((e) => ChapterDto.fromSource(e)).toList();
if (_orderMode == OrderMode.desc) return list;
return list.sortedByCompare(
(element) => element.readableAt, (DateTime a, DateTime b) => a.compareTo(b));
(element) => element.readableAt,
(DateTime a, DateTime b) => a.compareTo(b),
);
}

/// 检测漫画是否被订阅
Expand Down

0 comments on commit 92cc74c

Please sign in to comment.