Fixes #25;
Some checks reported errors
continuous-integration/drone/push Build was killed
continuous-integration/drone/pr Build is running

This commit is contained in:
aminecmi 2022-08-19 22:38:55 +02:00
parent c87473e8f1
commit 44a0469b17
2 changed files with 8 additions and 3 deletions

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())