Add support for the /sources/stats api endpoint

This commit is contained in:
davidoskky 2023-02-07 20:40:22 +01:00
parent e1c64cef46
commit 63b69b2822

View File

@ -183,7 +183,15 @@ class SelfossApi(private val appSettingsService: AppSettingsService) {
} }
}) })
suspend fun sources(): StatusAndData<ArrayList<SelfossModel.Source>> = suspend fun sourcesStats(): StatusAndData<ArrayList<SelfossModel.SourceStats>> =
bodyOrFailure(client.tryToGet(url("/sources/stats")) {
if (!shouldHavePostLogin()) {
parameter("username", appSettingsService.getUserName())
parameter("password", appSettingsService.getPassword())
}
})
suspend fun sourcesDetailed(): StatusAndData<ArrayList<SelfossModel.SourceDetail>> =
bodyOrFailure(client.tryToGet(url("/sources/list")) { bodyOrFailure(client.tryToGet(url("/sources/list")) {
if (!shouldHavePostLogin()) { if (!shouldHavePostLogin()) {
parameter("username", appSettingsService.getUserName()) parameter("username", appSettingsService.getUserName())