Skip to content

Commit

Permalink
Add getAnticipated endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbanes authored and ChrisKruegerDev committed Jul 26, 2024
1 parent 25b385e commit 0c8492b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/src/commonMain/kotlin/app/moviebase/trakt/api/TraktShowsApi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ class TraktShowsApi(private val client: HttpClient) {
extended?.let { parameterExtended(it) }
}

suspend fun getAnticipated(
page: Int,
limit: Int,
extended: TraktExtended? = null,
): List<TraktAnticipatedShow> = client.getByPaths(*pathShows("anticipated")) {
parameterPage(page)
parameterLimit(limit)
extended?.let { parameterExtended(it) }
}

suspend fun getRelated(
showId: String,
page: Int,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,9 @@ data class TraktTrendingShow(
@SerialName("show") val show: TraktShow? = null,
@SerialName("watchers") val watchers: Int? = null,
)

@Serializable
data class TraktAnticipatedShow(
@SerialName("show") val show: TraktShow? = null,
@SerialName("list_count") val listCount: Int? = null,
)

0 comments on commit 0c8492b

Please sign in to comment.