chore/sonarqube-fixes #35

Merged
AmineB merged 8 commits from chore/sonarqube-fixes into master 2022-08-24 12:37:37 +00:00
2 changed files with 8 additions and 3 deletions
Showing only changes of commit 44a0469b17 - Show all commits

View File

@ -329,8 +329,13 @@ class Repository(private val api: SelfossApi, private val apiDetails: ApiDetails
return success
}
suspend fun updateRemote(): Boolean =
isNetworkAvailable() && api.update()?.isSuccess == true
suspend fun updateRemote(): Boolean {
return if (isNetworkAvailable()) {
api.update()?.equals("finished") ?: false
} else {
false
}
}
suspend fun login(): Boolean {
var result = false

View File

@ -100,7 +100,7 @@ class SelfossApi(private val apiDetailsService: ApiDetailsService) {
parameter("password", apiDetailsService.getPassword())
}.body()
suspend fun update(): SelfossModel.SuccessResponse? =
suspend fun update(): String? =
client.get(url("/update")) {
parameter("username", apiDetailsService.getUserName())
parameter("password", apiDetailsService.getPassword())