Merge remote-tracking branch 'origin/master'

pull/2533/head
kunfei 2 years ago
commit 5b49c1c380
  1. 3
      app/src/main/java/io/legado/app/model/localBook/EpubFile.kt
  2. 4
      app/src/main/java/io/legado/app/ui/book/cache/CacheViewModel.kt

@ -119,9 +119,10 @@ class EpubFile(var book: Book) {
/**
* <image width="1038" height="670" xlink:href="..."/>
* ...titlepage.xhtml
* 大多数epub文件的封面页都会带有cover可以一定程度上解决封面读取问题
*/
if (chapter.url.contains("titlepage.xhtml") ||
chapter.url.contains("cover.xhtml")
chapter.url.contains("cover")
) {
return "<img src=\"cover.jpeg\" />"
}

@ -123,11 +123,9 @@ class CacheViewModel(application: Application) : BaseViewModel(application) {
exportMsg[book.bookUrl] = context.getString(R.string.export_success)
upAdapterLiveData.postValue(book.bookUrl)
}.onFinally {
mutex.withLock {
exportNumber--
}
}
}
@Suppress("BlockingMethodInNonBlockingContext")
private suspend fun export(doc: DocumentFile, book: Book) {
@ -288,11 +286,9 @@ class CacheViewModel(application: Application) : BaseViewModel(application) {
exportMsg[book.bookUrl] = context.getString(R.string.export_success)
upAdapterLiveData.postValue(book.bookUrl)
}.onFinally {
mutex.withLock {
exportNumber--
}
}
}
@Suppress("BlockingMethodInNonBlockingContext")
private suspend fun exportEpub(doc: DocumentFile, book: Book) {

Loading…
Cancel
Save