|
|
|
@ -67,13 +67,18 @@ class LocalMangaParser(private val uri: Uri) {
|
|
|
|
coverUrl = coverEntry?.let { uri.child(it, resolve = true).toString() }.orEmpty(),
|
|
|
|
coverUrl = coverEntry?.let { uri.child(it, resolve = true).toString() }.orEmpty(),
|
|
|
|
largeCoverUrl = null,
|
|
|
|
largeCoverUrl = null,
|
|
|
|
chapters = if (withDetails) {
|
|
|
|
chapters = if (withDetails) {
|
|
|
|
mangaInfo.chapters?.map { c ->
|
|
|
|
mangaInfo.chapters?.mapNotNull { c ->
|
|
|
|
c.copyInternal(
|
|
|
|
val path = index.getChapterFileName(c.id)?.toPath()
|
|
|
|
url = index.getChapterFileName(c.id)?.toPath()?.let {
|
|
|
|
if (path != null && !fileSystem.exists(rootPath / path)) {
|
|
|
|
uri.child(it, resolve = false).toString()
|
|
|
|
null
|
|
|
|
} ?: uri.toString(),
|
|
|
|
} else {
|
|
|
|
source = LocalMangaSource,
|
|
|
|
c.copyInternal(
|
|
|
|
)
|
|
|
|
url = path?.let {
|
|
|
|
|
|
|
|
uri.child(it, resolve = false).toString()
|
|
|
|
|
|
|
|
} ?: uri.toString(),
|
|
|
|
|
|
|
|
source = LocalMangaSource,
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
null
|
|
|
|
null
|
|
|
|
|