We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8c44249 commit efbbd53Copy full SHA for efbbd53
1 file changed
loading_sdk/async_api/client.py
@@ -527,7 +527,17 @@ async def get_total_thread_pages(self, thread_id):
527
:type thread_id: str
528
:rtype: dict
529
"""
530
- pass
+
531
+ response = await self.get_thread(thread_id)
532
533
+ if response["code"] != 200:
534
+ return response
535
536
+ thread_start = response["data"]["posts"][-1]
537
+ replies = max(thread_start["replies"], 1)
538
+ pages = math.ceil(replies / POSTS_PER_PAGE)
539
540
+ return pages
541
542
async def get_total_category_pages(self, category):
543
"""Returns total pages of a forum category.
0 commit comments