All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.app.moviebase.trakt.api.TraktRecommendationsApi.kt Maven / Gradle / Ivy

There is a newer version: 0.6.0
Show newest version
package app.moviebase.trakt.api

import app.moviebase.trakt.TraktExtended
import app.moviebase.trakt.core.getByPaths
import app.moviebase.trakt.core.parameterExtended
import app.moviebase.trakt.core.parameterLimit
import app.moviebase.trakt.core.parameterPage
import app.moviebase.trakt.model.TraktShow
import io.ktor.client.HttpClient

class TraktRecommendationsApi(private val client: HttpClient) {

    suspend fun getShows(
        page: Int,
        limit: Int,
        extended: TraktExtended? = null,
    ): List = client.getByPaths(*pathRecommendations("shows")) {
        parameterPage(page)
        parameterLimit(limit)
        extended?.let { parameterExtended(it) }
    }

    private fun pathRecommendations(vararg paths: String) = arrayOf("recommendations", *paths)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy