Skip to content

Commit

Permalink
TraktV2: use getPageCount helper method
Browse files Browse the repository at this point in the history
  • Loading branch information
UweTrottmann committed Sep 6, 2024
1 parent 90597af commit 9b2fc56
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,7 @@ class TraktEpisodeJob(
}
WatchedEpisode(number, season)
}
val pageCount = response.headers()["x-pagination-page-count"]?.toIntOrNull()
?: 1
val pageCount = TraktV2.getPageCount(response) ?: 1
Ok(HistoryPage(episodes, pageCount))
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class TraktNotesSync(
showIdsWithNotesToUploadOrRemove
)

pageCount = response.headers()["x-pagination-page-count"]?.toIntOrNull() ?: 1
pageCount = TraktV2.getPageCount(response) ?: 1
page++
} catch (e: Exception) {
Errors.logAndReport("get notes", e)
Expand Down

0 comments on commit 9b2fc56

Please sign in to comment.