Skip to content

Commit bb5bec6

Browse files
committed
TraktTools4: note collection limit, warn on missing page count header
1 parent 4c65930 commit bb5bec6

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.
@@ -74,6 +75,7 @@ object TraktTools4 {
7475
action = "get collected shows",
7576
reportIsNotVip = true // Should work even if not VIP
7677
) { page ->
78+
// 1000 is the maximum limit according to https://github.com/trakt/trakt-api/discussions/681
7779
traktSync.collectionShows(page, 1000, null)
7880
}
7981
}
@@ -113,6 +115,9 @@ object TraktTools4 {
113115
is TraktNonNullResponse.Success -> {
114116
allItems.addAll(response.data)
115117
totalPageCount = response.pageCount
118+
if (totalPageCount == null) {
119+
Timber.w("Page count header not found for '$action'")
120+
}
116121
currentPage++
117122
}
118123

0 commit comments

Comments
 (0)