Properly check if pagination is present

This commit is contained in:
Mark Veidemanis 2023-03-11 22:07:56 +00:00
parent 6d6b370327
commit fa2a6c9c77
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
1 changed files with 31 additions and 28 deletions

View File

@ -292,6 +292,7 @@ class LocalPlatformClient(ABC):
if "pagination" in ads: if "pagination" in ads:
if ads["pagination"]: if ads["pagination"]:
if "next" in ads["pagination"]: if "next" in ads["pagination"]:
if ads["pagination"]["next"] is not None:
page += 1 page += 1
ads_iter = await self.enum_ad_ids(page) ads_iter = await self.enum_ad_ids(page)
if ads_iter is None: if ads_iter is None:
@ -321,6 +322,7 @@ class LocalPlatformClient(ABC):
if "pagination" in ads: if "pagination" in ads:
if ads["pagination"]: if ads["pagination"]:
if "next" in ads["pagination"]: if "next" in ads["pagination"]:
if ads["pagination"]["next"] is not None:
page += 1 page += 1
ads_iter = await self.enum_ads(requested_asset, page) ads_iter = await self.enum_ads(requested_asset, page)
if ads_iter is None: if ads_iter is None:
@ -413,6 +415,7 @@ class LocalPlatformClient(ABC):
if "pagination" in ads: if "pagination" in ads:
if ads["pagination"]: if ads["pagination"]:
if "next" in ads["pagination"]: if "next" in ads["pagination"]:
if ads["pagination"]["next"] is not None:
page += 1 page += 1
ads_iter = await self.enum_public_ads( ads_iter = await self.enum_public_ads(
asset, currency, provider, page asset, currency, provider, page