Skip to content

Commit d6e1274

Browse files
committed
TraktTools4: note collection limit, warn on missing page count header
1 parent b7d9675 commit d6e1274

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

app/src/main/java/com/battlelancer/seriesguide/traktapi/TraktTools4.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import com.uwetrottmann.trakt5.services.Notes
1616
import com.uwetrottmann.trakt5.services.Sync
1717
import retrofit2.Call
1818
import retrofit2.awaitResponse
19+
import timber.log.Timber
1920

2021
/**
2122
* Uses response classes inheriting from a Kotlin sealed interface.
@@ -80,6 +81,7 @@ object TraktTools4 {
8081
action = "get collected shows",
8182
reportIsNotVip = true // Should work even if not VIP
8283
) { page ->
84+
// 1000 is the maximum limit according to https://github.com/trakt/trakt-api/discussions/681
8385
traktSync.collectionShows(page, 1000, null)
8486
}
8587
}
@@ -119,6 +121,9 @@ object TraktTools4 {
119121
is TraktNonNullResponse.Success -> {
120122
allItems.addAll(response.data)
121123
totalPageCount = response.pageCount
124+
if (totalPageCount == null) {
125+
Timber.w("Page count header not found for '$action'")
126+
}
122127
currentPage++
123128
}
124129

0 commit comments

Comments
 (0)