Skip to content

Commit

Permalink
Added changelog and variable from local data source
Browse files Browse the repository at this point in the history
  • Loading branch information
Aitorbp committed Jul 31, 2023
1 parent 49201f2 commit 2a27ce5
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 5 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Summary
* Enhancement - Copy/move conflict solved by users: [#3935](https://github.com/owncloud/android/issues/3935)
* Enhancement - Improve grid mode: [#4027](https://github.com/owncloud/android/issues/4027)
* Enhancement - File name conflict starting by (1): [#4040](https://github.com/owncloud/android/pull/4040)
* Enhancement - Respect app_providers_appsUrl value from capabilities: [#4075](https://github.com/owncloud/android/issues/4075)
* Enhancement - Support "per app" language change on Android 13+: [#4082](https://github.com/owncloud/android/issues/4082)

Details
Expand Down Expand Up @@ -119,6 +120,14 @@ Details
https://github.com/owncloud/android/issues/3946
https://github.com/owncloud/android/pull/4040

* Enhancement - Respect app_providers_appsUrl value from capabilities: [#4075](https://github.com/owncloud/android/issues/4075)

Now, the app receives the app_providers_appsUrl from the local database. Before of this
issue, the value was hardcoded.

https://github.com/owncloud/android/issues/4075
https://github.com/owncloud/android/pull/4113

* Enhancement - Support "per app" language change on Android 13+: [#4082](https://github.com/owncloud/android/issues/4082)

The locales_config.xml file has been created for the application to detect the language that
Expand Down
6 changes: 6 additions & 0 deletions changelog/unreleased/4113
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Enhancement: Respect app_providers_appsUrl value from capabilities

Now, the app receives the app_providers_appsUrl from the local database. Before of this issue, the value was hardcoded.

https://github.com/owncloud/android/issues/4075
https://github.com/owncloud/android/pull/4113
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ import com.owncloud.android.domain.webfinger.WebFingerRepository
import org.koin.dsl.module

val repositoryModule = module {
factory<AppRegistryRepository> { OCAppRegistryRepository(get(), get()) }
factory<AppRegistryRepository> { OCAppRegistryRepository(get(), get(), get()) }
factory<AuthenticationRepository> { OCAuthenticationRepository(get(), get()) }
factory<CapabilityRepository> { OCCapabilityRepository(get(), get(), get()) }
factory<FileRepository> { OCFileRepository(get(), get(), get(), get()) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,20 @@ package com.owncloud.android.data.appregistry

import com.owncloud.android.data.appregistry.datasources.LocalAppRegistryDataSource
import com.owncloud.android.data.appregistry.datasources.RemoteAppRegistryDataSource
import com.owncloud.android.data.capabilities.datasources.LocalCapabilitiesDataSource
import com.owncloud.android.domain.appregistry.AppRegistryRepository
import com.owncloud.android.domain.appregistry.model.AppRegistryMimeType
import kotlinx.coroutines.flow.Flow

class OCAppRegistryRepository(
private val localAppRegistryDataSource: LocalAppRegistryDataSource,
private val remoteAppRegistryDataSource: RemoteAppRegistryDataSource,
private val localCapabilitiesDataSource: LocalCapabilitiesDataSource
) : AppRegistryRepository {
override fun refreshAppRegistryForAccount(accountName: String) {
remoteAppRegistryDataSource.getAppRegistryForAccount(accountName).also {
val capabilities = localCapabilitiesDataSource.getCapabilityForAccount(accountName)//remoteAppRegistryDataSource.getCapabilities(accountName)
val appUrl = capabilities?.filesAppProviders?.appsUrl?.substring(1)
remoteAppRegistryDataSource.getAppRegistryForAccount(accountName, appUrl).also {
localAppRegistryDataSource.saveAppRegistryForAccount(it)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ import com.owncloud.android.domain.appregistry.model.AppRegistry

interface RemoteAppRegistryDataSource {
fun getAppRegistryForAccount(
accountName: String
accountName: String,
appUrl: String?
): AppRegistry

fun getUrlToOpenInWeb(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ import com.owncloud.android.lib.resources.appregistry.responses.AppRegistryRespo
class OCRemoteAppRegistryDataSource(
private val clientManager: ClientManager
) : RemoteAppRegistryDataSource {
override fun getAppRegistryForAccount(accountName: String): AppRegistry =
override fun getAppRegistryForAccount(accountName: String, appUrl: String?): AppRegistry =
executeRemoteOperation {
clientManager.getAppRegistryService(accountName).getAppRegistry()
clientManager.getAppRegistryService(accountName).getAppRegistry(appUrl)
}.toModel(accountName)

override fun getUrlToOpenInWeb(
Expand Down

0 comments on commit 2a27ce5

Please sign in to comment.