mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
Avoid catastrophic failure when cover can't be created in local source
Co-Authored-By: arkon <4098258+arkon@users.noreply.github.com>
This commit is contained in:
parent
d236536e86
commit
d64932a504
1 changed files with 36 additions and 31 deletions
|
@ -313,7 +313,8 @@ class LocalSource(private val context: Context) : CatalogueSource, UnmeteredSour
|
|||
}
|
||||
|
||||
private fun updateCover(chapter: SChapter, manga: SManga): File? {
|
||||
return when (val format = getFormat(chapter)) {
|
||||
return try {
|
||||
when (val format = getFormat(chapter)) {
|
||||
is Format.Directory -> {
|
||||
val entry = format.file.listFiles()
|
||||
?.sortedWith { f1, f2 -> f1.name.compareToCaseInsensitiveNaturalOrder(f2.name) }
|
||||
|
@ -349,6 +350,10 @@ class LocalSource(private val context: Context) : CatalogueSource, UnmeteredSour
|
|||
}
|
||||
}
|
||||
}
|
||||
} catch (e: Throwable) {
|
||||
Timber.e(e, "Error updating cover for ${manga.title}")
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
override fun getFilterList() = popularFilters
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue