Image loading optimized

Adds gallery to history when opened directly by gallery ID
Fixed blurred image
This commit is contained in:
tom5079
2019-07-11 21:24:25 +09:00
parent a79c023220
commit ee8e921e1a
11 changed files with 33 additions and 35 deletions

View File

@@ -27,6 +27,7 @@ import androidx.core.app.NotificationCompat
import androidx.core.app.NotificationManagerCompat
import androidx.core.app.TaskStackBuilder
import androidx.preference.PreferenceManager
import com.crashlytics.android.Crashlytics
import kotlinx.coroutines.*
import kotlinx.io.IOException
import kotlinx.serialization.json.Json
@@ -134,14 +135,11 @@ class GalleryDownloader(
//Cache doesn't exist. Load from internet
val reader = when {
useHiyobi -> {
xyz.quaver.hiyobi.getReader(galleryID).let {
when {
it.readerItems.isEmpty() -> {
useHiyobi = false
getReader(galleryID)
}
else -> it
}
try {
xyz.quaver.hiyobi.getReader(galleryID)
} catch(e: Exception) {
useHiyobi = false
getReader(galleryID)
}
}
else -> {
@@ -159,6 +157,7 @@ class GalleryDownloader(
reader
} catch (e: Exception) {
Crashlytics.logException(e)
Reader("", listOf())
}
}