Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f9ee79ed authored by Hasib Prince's avatar Hasib Prince
Browse files

resolved conflict: main is merged

parents 779b10ac 519c6370
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ plugins {

def versionMajor = 2
def versionMinor = 6
def versionPatch = 6
def versionPatch = 7

def getGitHash = { ->
    def stdOut = new ByteArrayOutputStream()
+5 −5
Original line number Diff line number Diff line
@@ -29,8 +29,8 @@ import foundation.e.apps.data.application.data.Application
import foundation.e.apps.data.application.data.Category
import foundation.e.apps.data.application.utils.CategoryType
import foundation.e.apps.data.application.utils.CategoryUtils
import foundation.e.apps.data.application.utils.transformToApplication
import foundation.e.apps.data.application.utils.transformToFusedCategory
import foundation.e.apps.data.application.utils.toApplication
import foundation.e.apps.data.application.utils.toCategory
import foundation.e.apps.data.cleanapk.data.categories.Categories
import foundation.e.apps.data.cleanapk.repositories.CleanApkRepository
import foundation.e.apps.data.enums.AppTag
@@ -134,7 +134,7 @@ class CategoryApiImpl @Inject constructor(
        val categoryList = mutableListOf<Category>()
        val result = handleNetworkResult {
            val playResponse = gplayRepository.getCategories(type).map { app ->
                val category = app.transformToFusedCategory()
                val category = app.toCategory()
                category.drawable =
                    CategoryUtils.provideAppsCategoryIconResource(
                        CategoryUtils.getCategoryIconName(category)
@@ -239,13 +239,13 @@ class CategoryApiImpl @Inject constructor(
        return handleNetworkResult {
            appList.forEach {
                val filter = applicationDataManager.getAppFilterLevel(
                    it.transformToApplication(context),
                    it.toApplication(context),
                    authData
                )

                if (filter.isUnFiltered()) {
                    filteredApplications.add(
                        it.transformToApplication(context).apply {
                        it.toApplication(context).apply {
                            this.filterLevel = filter
                        }
                    )
+12 −6
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ import dagger.hilt.android.qualifiers.ApplicationContext
import foundation.e.apps.R
import foundation.e.apps.data.ResultSupreme
import foundation.e.apps.data.application.data.Home
import foundation.e.apps.data.application.utils.transformToApplication
import foundation.e.apps.data.application.utils.toApplication
import foundation.e.apps.data.cleanapk.data.home.HomeScreen
import foundation.e.apps.data.cleanapk.repositories.CleanApkRepository
import foundation.e.apps.data.enums.ResultStatus
@@ -135,7 +135,10 @@ class HomeApiImpl @Inject constructor(
        return ResultSupreme.create(result.getResultStatus(), priorList)
    }

    private suspend fun handleCleanApkHomes(priorList: MutableList<Home>, appType: String): MutableList<Home> {
    private suspend fun handleCleanApkHomes(
        priorList: MutableList<Home>,
        appType: String
    ): MutableList<Home> {
        val response = if (appType == ApplicationApi.APP_TYPE_OPEN) {
            (cleanApkAppsRepository.getHomeScreenData() as Response<HomeScreen>).body()
        } else {
@@ -219,12 +222,15 @@ class HomeApiImpl @Inject constructor(
        }
    }

    private suspend fun fetchGPlayHome(authData: AuthData, priorList: MutableList<Home>): List<Home> {
    private suspend fun fetchGPlayHome(
        authData: AuthData,
        priorList: MutableList<Home>
    ): List<Home> {
        val list = mutableListOf<Home>()
        val gplayHomeData = gplayRepository.getHomeScreenData() as Map<String, List<App>>
        gplayHomeData.map {
            val fusedApps = it.value.map { app ->
                app.transformToApplication (context).apply {
                app.toApplication(context).apply {
                    applicationDataManager.updateStatus(this)
                    applicationDataManager.updateFilterLevel(authData, this)
                }
@@ -241,8 +247,8 @@ class HomeApiImpl @Inject constructor(

    private fun handleLimitedResult(homeList: List<Home>) {
        val gplayHomes = homeList.filter { fusedHome -> fusedHome.source.isEmpty() }
        val hasGplayLimitedResult = gplayHomes.any {
                fusedHome -> fusedHome.list.size < THRESHOLD_LIMITED_RESULT_HOME_PAGE
        val hasGplayLimitedResult = gplayHomes.any { fusedHome ->
            fusedHome.list.size < THRESHOLD_LIMITED_RESULT_HOME_PAGE
        }

        if (hasGplayLimitedResult) {
+4 −4
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ import foundation.e.apps.data.application.data.Application
import foundation.e.apps.data.application.data.Ratings
import foundation.e.apps.data.enums.Origin

fun App.transformToApplication(context: Context): Application {
fun App.toApplication(context: Context): Application {
    val app = Application(
        _id = this.id.toString(),
        author = this.developerName,
@@ -39,7 +39,7 @@ fun App.transformToApplication(context: Context): Application {
        latest_version_code = this.versionCode,
        latest_version_number = this.versionName,
        name = this.displayName,
        other_images_path = this.screenshots.transformToList(),
        other_images_path = this.screenshots.toList(),
        package_name = this.packageName,
        ratings = Ratings(
            usageQualityScore =
@@ -61,7 +61,7 @@ fun App.transformToApplication(context: Context): Application {
    return app
}

 fun Category.transformToFusedCategory(): foundation.e.apps.data.application.data.Category {
 fun Category.toCategory(): foundation.e.apps.data.application.data.Category {
    val id = this.browseUrl.substringAfter("cat=").substringBefore("&c=")
    return foundation.e.apps.data.application.data.Category(
        id = id.lowercase(),
@@ -71,7 +71,7 @@ fun App.transformToApplication(context: Context): Application {
    )
}

private fun MutableList<Artwork>.transformToList(): List<String> {
private fun MutableList<Artwork>.toList(): List<String> {
    val list = mutableListOf<String>()
    this.forEach {
        list.add(it.url)