|
|
@ -15,7 +15,9 @@ import io.legado.app.model.localBook.EpubFile |
|
|
|
import io.legado.app.utils.BitmapUtils |
|
|
|
import io.legado.app.utils.BitmapUtils |
|
|
|
import io.legado.app.utils.FileUtils |
|
|
|
import io.legado.app.utils.FileUtils |
|
|
|
import io.legado.app.utils.isXml |
|
|
|
import io.legado.app.utils.isXml |
|
|
|
|
|
|
|
import kotlinx.coroutines.Dispatchers.IO |
|
|
|
import kotlinx.coroutines.runBlocking |
|
|
|
import kotlinx.coroutines.runBlocking |
|
|
|
|
|
|
|
import kotlinx.coroutines.withContext |
|
|
|
import splitties.init.appCtx |
|
|
|
import splitties.init.appCtx |
|
|
|
import java.io.File |
|
|
|
import java.io.File |
|
|
|
import java.io.FileOutputStream |
|
|
|
import java.io.FileOutputStream |
|
|
@ -59,6 +61,7 @@ object ImageProvider { |
|
|
|
src: String, |
|
|
|
src: String, |
|
|
|
bookSource: BookSource? |
|
|
|
bookSource: BookSource? |
|
|
|
): File { |
|
|
|
): File { |
|
|
|
|
|
|
|
return withContext(IO) { |
|
|
|
val vFile = BookHelp.getImage(book, src) |
|
|
|
val vFile = BookHelp.getImage(book, src) |
|
|
|
if (!vFile.exists()) { |
|
|
|
if (!vFile.exists()) { |
|
|
|
if (book.isEpub()) { |
|
|
|
if (book.isEpub()) { |
|
|
@ -73,7 +76,8 @@ object ImageProvider { |
|
|
|
BookHelp.saveImage(bookSource, book, src) |
|
|
|
BookHelp.saveImage(bookSource, book, src) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return vFile |
|
|
|
return@withContext vFile |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|