|
|
@ -122,7 +122,7 @@ object BookHelp { |
|
|
|
cacheFolderName, |
|
|
|
cacheFolderName, |
|
|
|
book.getFolderName(), |
|
|
|
book.getFolderName(), |
|
|
|
cacheImageFolderName, |
|
|
|
cacheImageFolderName, |
|
|
|
"${MD5Utils.md5Encode16(src)}${getImageSuffix(src)}" |
|
|
|
"${MD5Utils.md5Encode16(src)}.${getImageSuffix(src)}" |
|
|
|
).writeBytes(it) |
|
|
|
).writeBytes(it) |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (e: Exception) { |
|
|
|
} catch (e: Exception) { |
|
|
@ -137,14 +137,14 @@ object BookHelp { |
|
|
|
cacheFolderName, |
|
|
|
cacheFolderName, |
|
|
|
book.getFolderName(), |
|
|
|
book.getFolderName(), |
|
|
|
cacheImageFolderName, |
|
|
|
cacheImageFolderName, |
|
|
|
"${MD5Utils.md5Encode16(src)}${getImageSuffix(src)}" |
|
|
|
"${MD5Utils.md5Encode16(src)}.${getImageSuffix(src)}" |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun getImageSuffix(src: String): String { |
|
|
|
fun getImageSuffix(src: String): String { |
|
|
|
var suffix = src.substringAfterLast(".").substringBefore(",") |
|
|
|
var suffix = src.substringAfterLast(".").substringBefore(",") |
|
|
|
if (suffix.length > 5) { |
|
|
|
if (suffix.length > 5) { |
|
|
|
suffix = ".jpg" |
|
|
|
suffix = "jpg" |
|
|
|
} |
|
|
|
} |
|
|
|
return suffix |
|
|
|
return suffix |
|
|
|
} |
|
|
|
} |
|
|
|