refactor(source/local): Convert to list after .map()

This commit is contained in:
Ahmad Ansori Palembani 2024-11-26 08:42:33 +07:00
parent b8a2a4de47
commit 128e14882d
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6

View file

@ -197,7 +197,7 @@ class LocalSource(private val context: Context) : CatalogueSource, UnmeteredSour
} }
} }
val mangas = mangaDirs.toList().map { mangaDir -> val mangas = mangaDirs.map { mangaDir ->
async { async {
SManga.create().apply { SManga.create().apply {
title = mangaDir.name.orEmpty() title = mangaDir.name.orEmpty()
@ -210,7 +210,7 @@ class LocalSource(private val context: Context) : CatalogueSource, UnmeteredSour
} }
} }
} }
}.awaitAll() }.toList().awaitAll()
MangasPage(mangas, false) MangasPage(mangas, false)
} }