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

Commit 09dbb33e authored by Vincent Bourgmayer's avatar Vincent Bourgmayer
Browse files

chore: rename SystemAppDefinitionApi into GitlabReleaseApi

parent 99abc931
Loading
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -26,10 +26,8 @@ import retrofit2.http.Path
/*
Those API method client must fit with gitlab releases API
https://docs.gitlab.com/ee/api/releases/#download-a-release-asset
TODO Option to consider at the end of the implementation:
Can we rename this interface into: GitlabReleaseApi ?
 */
interface SystemAppDefinitionApi {
interface GitlabReleaseApi {

    companion object {
        const val BASE_URL =
+4 −4
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ import timber.log.Timber
class SystemAppsUpdatesRepository @Inject constructor(
    @ApplicationContext private val context: Context,
    private val updatableSystemAppsApi: UpdatableSystemAppsApi,
    private val systemAppDefinitionApi: SystemAppDefinitionApi,
    private val gitlabReleaseApi: GitlabReleaseApi,
    private val applicationDataManager: ApplicationDataManager,
    private val appLoungePackageManager: AppLoungePackageManager,
) {
@@ -137,10 +137,10 @@ class SystemAppsUpdatesRepository @Inject constructor(
                return null
            }

            systemAppDefinitionApi.getSystemAppUpdateInfoByTag(projectId, releaseType, latestRelease.tagName)
            gitlabReleaseApi.getSystemAppUpdateInfoByTag(projectId, releaseType, latestRelease.tagName)

        } else {
            systemAppDefinitionApi.getLatestSystemAppUpdateInfo(projectId, releaseType)
            gitlabReleaseApi.getLatestSystemAppUpdateInfo(projectId, releaseType)
        }

        return if (response.isSuccessful ) {
@@ -152,7 +152,7 @@ class SystemAppsUpdatesRepository @Inject constructor(
    }

    private suspend fun getLatestReleaseByAndroidVersion(projectId: Int): GitlabReleaseInfo? {
        val gitlabReleaseList = systemAppDefinitionApi.getSystemAppReleases(projectId).body()
        val gitlabReleaseList = gitlabReleaseApi.getSystemAppReleases(projectId).body()

        return gitlabReleaseList?.filter {
            it.tagName.contains("api$androidVersionCode-")
+4 −4
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ import foundation.e.apps.data.ecloud.EcloudApiInterface
import foundation.e.apps.data.exodus.ExodusTrackerApi
import foundation.e.apps.data.fdroid.FdroidApiInterface
import foundation.e.apps.data.gitlab.UpdatableSystemAppsApi
import foundation.e.apps.data.gitlab.SystemAppDefinitionApi
import foundation.e.apps.data.gitlab.GitlabReleaseApi
import foundation.e.apps.data.parentalcontrol.fdroid.FDroidMonitorApi
import foundation.e.apps.data.parentalcontrol.googleplay.AgeGroupApi
import foundation.e.apps.di.network.NetworkModule.getYamlFactory
@@ -152,13 +152,13 @@ class RetrofitApiModule {
    fun provideSystemAppDefinitionApi(
        okHttpClient: OkHttpClient,
        moshi: Moshi,
    ): SystemAppDefinitionApi {
    ): GitlabReleaseApi {
        return Retrofit.Builder()
            .baseUrl(SystemAppDefinitionApi.BASE_URL)
            .baseUrl(GitlabReleaseApi.BASE_URL)
            .client(okHttpClient)
            .addConverterFactory(MoshiConverterFactory.create(moshi))
            .build()
            .create(SystemAppDefinitionApi::class.java)
            .create(GitlabReleaseApi::class.java)
    }

}