|
|
@ -96,16 +96,21 @@ object BookHelp { |
|
|
|
} |
|
|
|
} |
|
|
|
downloadImages.add(src) |
|
|
|
downloadImages.add(src) |
|
|
|
val analyzeUrl = AnalyzeUrl(src) |
|
|
|
val analyzeUrl = AnalyzeUrl(src) |
|
|
|
analyzeUrl.getImageBytes(book.origin)?.let { |
|
|
|
try { |
|
|
|
FileUtils.createFileIfNotExist( |
|
|
|
analyzeUrl.getImageBytes(book.origin)?.let { |
|
|
|
downloadDir, |
|
|
|
FileUtils.createFileIfNotExist( |
|
|
|
cacheFolderName, |
|
|
|
downloadDir, |
|
|
|
book.getFolderName(), |
|
|
|
cacheFolderName, |
|
|
|
cacheImageFolderName, |
|
|
|
book.getFolderName(), |
|
|
|
"${MD5Utils.md5Encode16(src)}${getImageSuffix(src)}" |
|
|
|
cacheImageFolderName, |
|
|
|
).writeBytes(it) |
|
|
|
"${MD5Utils.md5Encode16(src)}${getImageSuffix(src)}" |
|
|
|
|
|
|
|
).writeBytes(it) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} catch (e: Exception) { |
|
|
|
|
|
|
|
e.printStackTrace() |
|
|
|
|
|
|
|
} finally { |
|
|
|
|
|
|
|
downloadImages.remove(src) |
|
|
|
} |
|
|
|
} |
|
|
|
downloadImages.remove(src) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun getImage(book: Book, src: String): File { |
|
|
|
fun getImage(book: Book, src: String): File { |
|
|
|