Memory usage optimization
This commit is contained in:
Pupil
2020-02-29 13:23:37 +09:00
parent 20bc9461de
commit 24486d13f2
8 changed files with 25 additions and 51 deletions

View File

@@ -175,8 +175,12 @@ fun getGalleryIDsFromNozomi(area: String?, tag: String, language: String) : List
else -> "$protocol//$domain/$compressed_nozomi_prefix/$area/$tag-$language$nozomiextension"
}
val bytes = URL(nozomiAddress).openConnection(proxy).getInputStream().use {
it.readBytes()
val bytes = try {
URL(nozomiAddress).openConnection(proxy).getInputStream().use {
it.readBytes()
}
} catch (e: Exception) {
return emptyList()
}
val nozomi = ArrayList<Int>()