From 63b69b2822ce7e486c4d375e273b1bd8582558cb Mon Sep 17 00:00:00 2001 From: davidoskky Date: Tue, 7 Feb 2023 20:40:22 +0100 Subject: [PATCH] Add support for the /sources/stats api endpoint --- .../amine/apps/readerforselfossv2/rest/SelfossApi.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/shared/src/commonMain/kotlin/bou/amine/apps/readerforselfossv2/rest/SelfossApi.kt b/shared/src/commonMain/kotlin/bou/amine/apps/readerforselfossv2/rest/SelfossApi.kt index 4d10b3b..3870852 100644 --- a/shared/src/commonMain/kotlin/bou/amine/apps/readerforselfossv2/rest/SelfossApi.kt +++ b/shared/src/commonMain/kotlin/bou/amine/apps/readerforselfossv2/rest/SelfossApi.kt @@ -183,7 +183,15 @@ class SelfossApi(private val appSettingsService: AppSettingsService) { } }) - suspend fun sources(): StatusAndData> = + suspend fun sourcesStats(): StatusAndData> = + bodyOrFailure(client.tryToGet(url("/sources/stats")) { + if (!shouldHavePostLogin()) { + parameter("username", appSettingsService.getUserName()) + parameter("password", appSettingsService.getPassword()) + } + }) + + suspend fun sourcesDetailed(): StatusAndData> = bodyOrFailure(client.tryToGet(url("/sources/list")) { if (!shouldHavePostLogin()) { parameter("username", appSettingsService.getUserName())