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