Improve comic chapters.

This commit is contained in:
2025-02-20 13:08:55 +08:00
parent 2b3c7a8564
commit bd5d10e919
14 changed files with 324 additions and 97 deletions

View File

@@ -98,7 +98,7 @@ abstract mixin class _ComicPageActions {
void read([int? ep, int? page]) {
App.rootContext
.to(
() => Reader(
() => Reader(
type: comic.comicType,
cid: comic.id,
name: comic.title,
@@ -219,7 +219,7 @@ abstract mixin class _ComicPageActions {
isGettingLink = true;
});
var res =
await comicSource.archiveDownloader!.getDownloadUrl(
await comicSource.archiveDownloader!.getDownloadUrl(
comic.id,
archives![selected].id,
);
@@ -262,7 +262,7 @@ abstract mixin class _ComicPageActions {
if (localComic != null) {
for (int i = 0; i < comic.chapters!.length; i++) {
if (localComic.downloadedChapters
.contains(comic.chapters!.keys.elementAt(i))) {
.contains(comic.chapters!.ids.elementAt(i))) {
downloaded.add(i);
}
}
@@ -270,8 +270,8 @@ abstract mixin class _ComicPageActions {
await showSideBar(
App.rootContext,
_SelectDownloadChapter(
comic.chapters!.values.toList(),
(v) => selected = v,
comic.chapters!.titles.toList(),
(v) => selected = v,
downloaded,
),
);
@@ -281,7 +281,7 @@ abstract mixin class _ComicPageActions {
comicId: comic.id,
comic: comic,
chapters: selected!.map((i) {
return comic.chapters!.keys.elementAt(i);
return comic.chapters!.ids.elementAt(i);
}).toList(),
));
}
@@ -298,13 +298,13 @@ abstract mixin class _ComicPageActions {
var context = App.mainNavigatorKey!.currentContext!;
if (config['action'] == 'search') {
context.to(() => SearchResultPage(
text: config['keyword'] ?? '',
sourceKey: comicSource.key,
options: const [],
));
text: config['keyword'] ?? '',
sourceKey: comicSource.key,
options: const [],
));
} else if (config['action'] == 'category') {
context.to(
() => CategoryComicsPage(
() => CategoryComicsPage(
category: config['keyword'] ?? '',
categoryKey: comicSource.categoryData!.key,
param: config['param'],
@@ -432,4 +432,4 @@ abstract mixin class _ComicPageActions {
),
);
}
}
}