|
|
@ -6,14 +6,11 @@ import io.legado.app.data.appDb |
|
|
|
import io.legado.app.data.entities.Book |
|
|
|
import io.legado.app.data.entities.Book |
|
|
|
import io.legado.app.data.entities.BookChapter |
|
|
|
import io.legado.app.data.entities.BookChapter |
|
|
|
import io.legado.app.data.entities.BookSource |
|
|
|
import io.legado.app.data.entities.BookSource |
|
|
|
import io.legado.app.help.coroutine.Coroutine |
|
|
|
|
|
|
|
import io.legado.app.model.analyzeRule.AnalyzeUrl |
|
|
|
import io.legado.app.model.analyzeRule.AnalyzeUrl |
|
|
|
import io.legado.app.model.localBook.LocalBook |
|
|
|
import io.legado.app.model.localBook.LocalBook |
|
|
|
import io.legado.app.utils.* |
|
|
|
import io.legado.app.utils.* |
|
|
|
import kotlinx.coroutines.CoroutineScope |
|
|
|
import kotlinx.coroutines.* |
|
|
|
import kotlinx.coroutines.Deferred |
|
|
|
import kotlinx.coroutines.Dispatchers.IO |
|
|
|
import kotlinx.coroutines.async |
|
|
|
|
|
|
|
import kotlinx.coroutines.delay |
|
|
|
|
|
|
|
import org.apache.commons.text.similarity.JaccardSimilarity |
|
|
|
import org.apache.commons.text.similarity.JaccardSimilarity |
|
|
|
import splitties.init.appCtx |
|
|
|
import splitties.init.appCtx |
|
|
|
import java.io.File |
|
|
|
import java.io.File |
|
|
@ -44,8 +41,8 @@ object BookHelp { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 清除已删除书的缓存 |
|
|
|
* 清除已删除书的缓存 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
fun clearRemovedCache() { |
|
|
|
suspend fun clearInvalidCache() { |
|
|
|
Coroutine.async { |
|
|
|
withContext(IO) { |
|
|
|
val bookFolderNames = appDb.bookDao.all.map { |
|
|
|
val bookFolderNames = appDb.bookDao.all.map { |
|
|
|
it.getFolderName() |
|
|
|
it.getFolderName() |
|
|
|
} |
|
|
|
} |
|
|
|