mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-06-30 17:34:39 -05:00
no online fetch on backup
This commit is contained in:
@@ -36,7 +36,7 @@ import java.time.Instant
|
||||
|
||||
object Chapter {
|
||||
/** get chapter list when showing a manga */
|
||||
suspend fun getChapterList(mangaId: Int, onlineFetch: Boolean = false): List<ChapterDataClass> {
|
||||
suspend fun getChapterList(mangaId: Int, onlineFetch: Boolean = false, onlineFetchOnEmpty: Boolean = true): List<ChapterDataClass> {
|
||||
return if (onlineFetch) {
|
||||
getSourceChapters(mangaId)
|
||||
} else {
|
||||
@@ -47,7 +47,10 @@ object Chapter {
|
||||
ChapterTable.toDataClass(it)
|
||||
}
|
||||
}.ifEmpty {
|
||||
getSourceChapters(mangaId)
|
||||
if (onlineFetchOnEmpty)
|
||||
getSourceChapters(mangaId)
|
||||
else
|
||||
emptyList()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ object ProtoBackupExport : ProtoBackupBase() {
|
||||
val mangaId = mangaRow[MangaTable.id].value
|
||||
|
||||
if (flags.includeChapters) {
|
||||
val chapters = runBlocking { Chapter.getChapterList(mangaId) }
|
||||
val chapters = runBlocking { Chapter.getChapterList(mangaId, onlineFetchOnEmpty = false) }
|
||||
backupManga.chapters = chapters.map {
|
||||
BackupChapter(
|
||||
it.url,
|
||||
|
||||
Reference in New Issue
Block a user