|
|
@@ -34,13 +34,27 @@ import io.legado.app.model.CacheBook
|
|
|
import io.legado.app.service.ExportBookService
|
|
|
import io.legado.app.ui.about.AppLogDialog
|
|
|
import io.legado.app.ui.file.HandleFileContract
|
|
|
-import io.legado.app.utils.*
|
|
|
+import io.legado.app.utils.ACache
|
|
|
+import io.legado.app.utils.FileDoc
|
|
|
+import io.legado.app.utils.applyTint
|
|
|
+import io.legado.app.utils.checkWrite
|
|
|
+import io.legado.app.utils.cnCompare
|
|
|
+import io.legado.app.utils.enableCustomExport
|
|
|
+import io.legado.app.utils.isContentScheme
|
|
|
+import io.legado.app.utils.observeEvent
|
|
|
+import io.legado.app.utils.parseToUri
|
|
|
+import io.legado.app.utils.showDialogFragment
|
|
|
+import io.legado.app.utils.startService
|
|
|
+import io.legado.app.utils.toastOnUi
|
|
|
+import io.legado.app.utils.verificationField
|
|
|
import io.legado.app.utils.viewbindingdelegate.viewBinding
|
|
|
import kotlinx.coroutines.Dispatchers.IO
|
|
|
import kotlinx.coroutines.Job
|
|
|
-import kotlinx.coroutines.flow.*
|
|
|
+import kotlinx.coroutines.flow.conflate
|
|
|
+import kotlinx.coroutines.flow.map
|
|
|
import kotlinx.coroutines.launch
|
|
|
import kotlinx.coroutines.withContext
|
|
|
+import kotlin.math.max
|
|
|
|
|
|
/**
|
|
|
* cache/download 缓存界面
|
|
|
@@ -146,7 +160,7 @@ class CacheActivity : VMBaseActivity<ActivityCacheBookBinding, CacheViewModel>()
|
|
|
this@CacheActivity,
|
|
|
book,
|
|
|
book.durChapterIndex,
|
|
|
- book.totalChapterNum
|
|
|
+ book.lastChapterIndex
|
|
|
)
|
|
|
}
|
|
|
} else {
|
|
|
@@ -198,6 +212,10 @@ class CacheActivity : VMBaseActivity<ActivityCacheBookBinding, CacheViewModel>()
|
|
|
}
|
|
|
|
|
|
3 -> booksDownload.sortedBy { it.order }
|
|
|
+ 4 -> booksDownload.sortedByDescending {
|
|
|
+ max(it.latestChapterTime, it.durChapterTime)
|
|
|
+ }
|
|
|
+
|
|
|
else -> booksDownload.sortedByDescending { it.durChapterTime }
|
|
|
}
|
|
|
}.conflate().collect { books ->
|