优化
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -268,7 +268,7 @@ object LocalBook {
|
|||||||
var doc = treeDoc!!.findFile(fileName)
|
var doc = treeDoc!!.findFile(fileName)
|
||||||
if (doc == null) {
|
if (doc == null) {
|
||||||
doc = treeDoc.createFile(FileUtils.getMimeType(fileName), fileName)
|
doc = treeDoc.createFile(FileUtils.getMimeType(fileName), fileName)
|
||||||
?: throw SecurityException("Permission Denial")
|
?: throw SecurityException("请重新设置书籍保存位置\nPermission Denial")
|
||||||
}
|
}
|
||||||
appCtx.contentResolver.openOutputStream(doc.uri)!!.use { oStream ->
|
appCtx.contentResolver.openOutputStream(doc.uri)!!.use { oStream ->
|
||||||
inputStream.copyTo(oStream)
|
inputStream.copyTo(oStream)
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ class FileAssociationActivity :
|
|||||||
if (doc == null || fileDoc.lastModified > doc.lastModified()) {
|
if (doc == null || fileDoc.lastModified > doc.lastModified()) {
|
||||||
if (doc == null) {
|
if (doc == null) {
|
||||||
doc = treeDoc.createFile(FileUtils.getMimeType(name), name)
|
doc = treeDoc.createFile(FileUtils.getMimeType(name), name)
|
||||||
?: throw SecurityException("Permission Denial")
|
?: throw SecurityException("请重新设置书籍保存位置\nPermission Denial")
|
||||||
}
|
}
|
||||||
contentResolver.openOutputStream(doc.uri)!!.use { oStream ->
|
contentResolver.openOutputStream(doc.uri)!!.use { oStream ->
|
||||||
inputStream.copyTo(oStream)
|
inputStream.copyTo(oStream)
|
||||||
|
|||||||
@@ -60,8 +60,8 @@ object ImageUtils {
|
|||||||
): String? {
|
): String? {
|
||||||
return when (source) {
|
return when (source) {
|
||||||
is BookSource ->
|
is BookSource ->
|
||||||
if (isCover) source?.coverDecodeJs else source?.getContentRule()?.imageDecode
|
if (isCover) source.coverDecodeJs else source.getContentRule().imageDecode
|
||||||
is RssSource -> source?.coverDecodeJs
|
is RssSource -> source.coverDecodeJs
|
||||||
else -> null
|
else -> null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user