Simplify fetching manga and chapters

This commit is contained in:
Syer10
2026-06-17 13:24:38 -04:00
parent 3a78453a02
commit 33ec15c136
5 changed files with 45 additions and 23 deletions

View File

@@ -3,6 +3,7 @@ package suwayomi.tachidesk.opds.impl
import io.github.oshai.kotlinlogging.KotlinLogging
import org.jetbrains.exposed.v1.core.SortOrder
import suwayomi.tachidesk.i18n.MR
import suwayomi.tachidesk.manga.impl.Manga
import suwayomi.tachidesk.manga.impl.MangaList.proxyThumbnailUrl
import suwayomi.tachidesk.manga.model.table.ChapterTable
import suwayomi.tachidesk.opds.constants.OpdsConstants
@@ -647,8 +648,7 @@ object OpdsFeedBuilder {
// If no chapters are found in the database, attempt to fetch them from the source.
if (chapterEntries.isEmpty() && totalChapters == 0L) {
try {
suwayomi.tachidesk.manga.impl.Chapter
.fetchChapterList(mangaId)
Manga.updateMangaAndChapters(mangaId, updateManga = false)
// Re-query after fetching.
val (refetchedChapters, refetchedTotal) =