This commit is contained in:
len 2017-01-30 21:04:56 +01:00
parent 9320d1f7a4
commit 772bef05fc

View File

@ -156,9 +156,9 @@ class LocalSource(private val context: Context) : CatalogueSource {
if (thumbnail_url == null) { if (thumbnail_url == null) {
val chapters = fetchChapterList(this).toBlocking().first() val chapters = fetchChapterList(this).toBlocking().first()
if (chapters.isNotEmpty()) { if (chapters.isNotEmpty()) {
val url = fetchPageList(chapters.last()).toBlocking().first().firstOrNull()?.url val uri = fetchPageList(chapters.last()).toBlocking().first().firstOrNull()?.uri
if (url != null) { if (uri != null) {
val input = context.contentResolver.openInputStream(Uri.parse(url)) val input = context.contentResolver.openInputStream(uri)
try { try {
val dest = updateCover(context, this, input) val dest = updateCover(context, this, input)
thumbnail_url = dest?.absolutePath thumbnail_url = dest?.absolutePath