mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
fix(source/local): Don't crash trying to get manga language
XML is pain
This commit is contained in:
parent
1cb635999e
commit
119b1c64b2
1 changed files with 10 additions and 3 deletions
|
@ -69,11 +69,18 @@ class LocalSource(private val context: Context) : CatalogueSource, UnmeteredSour
|
|||
.filter { !it.isDirectory }
|
||||
.firstOrNull { it.name == COMIC_INFO_FILE }
|
||||
|
||||
return if (localDetails != null) {
|
||||
decodeComicInfo(localDetails.openInputStream()).language?.value ?: "other"
|
||||
} else {
|
||||
"other"
|
||||
val lang = if (localDetails != null) {
|
||||
try {
|
||||
decodeComicInfo(localDetails.openInputStream()).language?.value
|
||||
} catch (e: Exception) {
|
||||
Logger.e(e) { "Unable to retrieve manga language" }
|
||||
null
|
||||
}
|
||||
} else {
|
||||
null
|
||||
}
|
||||
|
||||
return lang ?: "other"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue