mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
fix: Check if chapterFile is directory before getting ComicInfo
This commit is contained in:
parent
b87cbc87d6
commit
da1b9abe2a
1 changed files with 6 additions and 3 deletions
|
@ -282,9 +282,12 @@ class LocalSource(private val context: Context) : CatalogueSource, UnmeteredSour
|
|||
val chapters = getBaseDirectory().findFile(manga.url)?.listFiles().orEmpty()
|
||||
.filter { it.isDirectory || isSupportedFile(it.extension.orEmpty()) }
|
||||
.map { chapterFile ->
|
||||
val chapterComicInfo = chapterFile.findFile(COMIC_INFO_FILE)?.let {
|
||||
decodeComicInfo(it.openInputStream(), xml)
|
||||
}
|
||||
val chapterComicInfo =
|
||||
if (chapterFile.isDirectory)
|
||||
chapterFile.findFile(COMIC_INFO_FILE)?.let {
|
||||
decodeComicInfo(it.openInputStream(), xml)
|
||||
}
|
||||
else null
|
||||
|
||||
SChapter.create().apply {
|
||||
url = "${manga.url}/${chapterFile.name}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue