This commit is contained in:
Horis
2025-03-06 14:51:14 +08:00
parent fd77ef0705
commit 64d58bb224
@@ -19,9 +19,9 @@ import io.legado.app.help.book.update
import io.legado.app.help.config.AppConfig import io.legado.app.help.config.AppConfig
import io.legado.app.help.coroutine.Coroutine import io.legado.app.help.coroutine.Coroutine
import io.legado.app.help.globalExecutor import io.legado.app.help.globalExecutor
import io.legado.app.model.webBook.WebBook
import io.legado.app.ui.book.manga.entities.MangaContent import io.legado.app.ui.book.manga.entities.MangaContent
import io.legado.app.ui.book.manga.entities.ReaderLoading import io.legado.app.ui.book.manga.entities.ReaderLoading
import io.legado.app.model.webBook.WebBook
import io.legado.app.utils.NetworkUtils import io.legado.app.utils.NetworkUtils
import io.legado.app.utils.mapIndexed import io.legado.app.utils.mapIndexed
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
@@ -58,7 +58,6 @@ object ReadManga : CoroutineScope by MainScope() {
var simulatedChapterSize = 0 var simulatedChapterSize = 0
var mCallback: Callback? = null var mCallback: Callback? = null
var gameOver = false var gameOver = false
var mTopChapter: BookChapter? = null
var preDownloadTask: Job? = null var preDownloadTask: Job? = null
val downloadedChapters = hashSetOf<Int>() val downloadedChapters = hashSetOf<Int>()
val downloadFailChapters = hashMapOf<Int, Int>() val downloadFailChapters = hashMapOf<Int, Int>()
@@ -250,7 +249,6 @@ object ReadManga : CoroutineScope by MainScope() {
simulatedChapterSize = 0 simulatedChapterSize = 0
mCallback = null mCallback = null
gameOver = false gameOver = false
mTopChapter = null
preDownloadTask?.cancel() preDownloadTask?.cancel()
preDownloadTask = null preDownloadTask = null
downloadedChapters.clear() downloadedChapters.clear()
@@ -268,12 +266,6 @@ object ReadManga : CoroutineScope by MainScope() {
content: String, content: String,
book: Book, book: Book,
) { ) {
if (mTopChapter != null && mTopChapter!!.title != chapterTitle
&& BookHelp.hasContent(book, mTopChapter!!)
) {
BookHelp.delContent(book, chapter)
}
mTopChapter = chapter
chapterTitle = chapter.title chapterTitle = chapter.title
if (chapter.index !in durChapterIndex - 1..durChapterIndex + 1) { if (chapter.index !in durChapterIndex - 1..durChapterIndex + 1) {
return return