Improved the downloading for custom apps.

* Improved the CI to run the test cases for custom app on same emulator.
This commit is contained in:
MohitMaliFtechiz 2024-08-15 14:22:03 +05:30 committed by Kelson
parent 3d29faf02e
commit 23fa4500df
2 changed files with 3 additions and 1 deletions

View File

@ -101,7 +101,7 @@ jobs:
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
ram-size: 4096M
cores: 4
force-avd-creation: true
force-avd-creation: false
sdcard-path-or-size: 2048M
disable-animations: true
heap-size: 512M

View File

@ -20,6 +20,7 @@ package org.kiwix.kiwixmobile.core.downloader
import android.annotation.SuppressLint
import io.reactivex.Observable
import io.reactivex.schedulers.Schedulers
import org.kiwix.kiwixmobile.core.dao.DownloadRoomDao
import org.kiwix.kiwixmobile.core.data.remote.KiwixService
import org.kiwix.kiwixmobile.core.entity.LibraryNetworkEntity
@ -38,6 +39,7 @@ class DownloaderImpl @Inject constructor(
override fun download(book: LibraryNetworkEntity.Book) {
urlProvider(book)
.take(1)
.subscribeOn(Schedulers.io())
.subscribe(
{
downloadRoomDao.addIfDoesNotExist(it, book, downloadRequester, sharedPreferenceUtil)