[#1676] Reorder source pages (#1683)

Some sources don't properly index their pages in some situations, so
follow Mihon and reindex
This commit is contained in:
Constantin Piber
2025-10-03 16:38:10 +02:00
committed by GitHub
parent fb05371ac2
commit 02aada7f08

View File

@@ -194,14 +194,15 @@ private class ChapterForDownload(
val mangaEntry = transaction { MangaTable.selectAll().where { MangaTable.id eq mangaId }.first() }
val source = getCatalogueSourceOrStub(mangaEntry[MangaTable.sourceReference])
return source.getPageList(
SChapter.create().apply {
url = chapterEntry[ChapterTable.url]
name = chapterEntry[ChapterTable.name]
scanlator = chapterEntry[ChapterTable.scanlator]
chapter_number = chapterEntry[ChapterTable.chapter_number]
date_upload = chapterEntry[ChapterTable.date_upload]
},
)
return source
.getPageList(
SChapter.create().apply {
url = chapterEntry[ChapterTable.url]
name = chapterEntry[ChapterTable.name]
scanlator = chapterEntry[ChapterTable.scanlator]
chapter_number = chapterEntry[ChapterTable.chapter_number]
date_upload = chapterEntry[ChapterTable.date_upload]
},
).mapIndexed { index, page -> Page(index, page.url, page.imageUrl, page.uri) }
}
}