#733: Improve perfs on getChapterList with onlineFetch (Less databases calls) (#737)

* improve(#733): less databases calls on getChapterList with onlineFetch

* improve(#733): fixes (delete with ids), tried batch update but not successfull

* improve(#733): fixes (batch update)

* improve(#733): clean imports

* improve(#733): fixes SChapter to ChapterDataClass,

* improve(#733): re-added recognize chap number

---------

Co-authored-by: Alexandre JOURNET <alexandre.journet@axopen.com>
This commit is contained in:
Alexandre Journet
2023-10-31 00:47:03 +01:00
committed by GitHub
parent 9d2b098837
commit 6d33d72663
2 changed files with 109 additions and 45 deletions

View File

@@ -1,5 +1,7 @@
package suwayomi.tachidesk.manga.model.dataclass
import eu.kanade.tachiyomi.source.model.SChapter
/*
* Copyright (C) Contributors to the Suwayomi project
*
@@ -38,4 +40,33 @@ data class ChapterDataClass(
val chapterCount: Int? = null,
/** used to store client specific values */
val meta: Map<String, String> = emptyMap(),
)
) {
companion object {
fun fromSChapter(
sChapter: SChapter,
id: Int,
index: Int,
fetchedAt: Long,
mangaId: Int,
realUrl: String?,
): ChapterDataClass {
return ChapterDataClass(
id = id,
url = sChapter.url,
name = sChapter.name,
uploadDate = sChapter.date_upload,
chapterNumber = sChapter.chapter_number,
scanlator = sChapter.scanlator ?: "",
index = index,
fetchedAt = fetchedAt,
realUrl = realUrl,
mangaId = mangaId,
read = false,
bookmarked = false,
lastPageRead = 0,
lastReadAt = 0,
downloaded = false,
)
}
}
}