Skip to content

Commit 5223eec

Browse files
committed
paging object default size
1 parent 674bc17 commit 5223eec

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

build.gradle.kts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,3 @@ gradle.taskGraph.whenReady {
200200
console.printf("\nThanks.\n\n")
201201
}
202202
}
203-
204-
tasks {
205-
val dokka by getting(DokkaTask::class) {
206-
outputFormat = "html"
207-
outputDirectory = "/docs"
208-
}
209-
}

src/commonMain/kotlin/com.adamratzman.spotify/models/PagingObjects.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class PagingObject<T : Any>(
6565
override val next: String?,
6666
override val offset: Int,
6767
override val previous: String?,
68-
override val total: Int
68+
override val total: Int = 0
6969
) : AbstractPagingObject<T>(href, items, limit, next, offset, previous, total) {
7070
@Suppress("UNCHECKED_CAST")
7171
override suspend fun getImpl(type: PagingTraversalType): AbstractPagingObject<T>? {
@@ -137,7 +137,7 @@ class CursorBasedPagingObject<T : Any>(
137137
override val limit: Int,
138138
override val next: String?,
139139
@SerialName("cursors") val cursor: Cursor,
140-
override val total: Int = items.size
140+
override val total: Int = 0
141141
) : AbstractPagingObject<T>(href, items, limit, next, 0, null, total) {
142142
/**
143143
* Get all CursorBasedPagingObjects associated with the request

src/commonTest/kotlin/com.adamratzman/spotify/public/PublicTracksAPITest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ package com.adamratzman.spotify.public
44
import com.adamratzman.spotify.SpotifyException
55
import com.adamratzman.spotify.api
66
import com.adamratzman.spotify.utils.Market
7+
import org.spekframework.spek2.Spek
8+
import org.spekframework.spek2.style.specification.describe
79
import kotlin.test.assertEquals
810
import kotlin.test.assertFailsWith
911
import kotlin.test.assertNull
1012
import kotlin.test.assertTrue
11-
import org.spekframework.spek2.Spek
12-
import org.spekframework.spek2.style.specification.describe
1313

1414
class PublicTracksAPITest : Spek({
1515
describe("Track API (Public View) test") {

0 commit comments

Comments
 (0)