Fixes #25;
This commit is contained in:
parent
c87473e8f1
commit
44a0469b17
@ -329,8 +329,13 @@ class Repository(private val api: SelfossApi, private val apiDetails: ApiDetails
|
|||||||
return success
|
return success
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun updateRemote(): Boolean =
|
suspend fun updateRemote(): Boolean {
|
||||||
isNetworkAvailable() && api.update()?.isSuccess == true
|
return if (isNetworkAvailable()) {
|
||||||
|
api.update()?.equals("finished") ?: false
|
||||||
|
} else {
|
||||||
|
false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
suspend fun login(): Boolean {
|
suspend fun login(): Boolean {
|
||||||
var result = false
|
var result = false
|
||||||
|
@ -100,7 +100,7 @@ class SelfossApi(private val apiDetailsService: ApiDetailsService) {
|
|||||||
parameter("password", apiDetailsService.getPassword())
|
parameter("password", apiDetailsService.getPassword())
|
||||||
}.body()
|
}.body()
|
||||||
|
|
||||||
suspend fun update(): SelfossModel.SuccessResponse? =
|
suspend fun update(): String? =
|
||||||
client.get(url("/update")) {
|
client.get(url("/update")) {
|
||||||
parameter("username", apiDetailsService.getUserName())
|
parameter("username", apiDetailsService.getUserName())
|
||||||
parameter("password", apiDetailsService.getPassword())
|
parameter("password", apiDetailsService.getPassword())
|
||||||
|
Loading…
Reference in New Issue
Block a user