File tree Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -580,7 +580,21 @@ def get_collection_items(
580580 'href' : f'{ uri } ?f={ F_HTML } { serialized_query_params } '
581581 }])
582582
583- if offset > 0 :
583+ next_link = False
584+ prev_link = False
585+
586+ if 'next' in [link ['rel' ] for link in content ['links' ]]:
587+ LOGGER .debug ('Using next link from provider' )
588+ else :
589+ if content .get ('numberMatched' , - 1 ) > (limit + offset ):
590+ next_link = True
591+ elif len (content ['features' ]) == limit :
592+ next_link = True
593+
594+ if offset > 0 :
595+ prev_link = True
596+
597+ if prev_link :
584598 prev = max (0 , offset - limit )
585599 content ['links' ].append (
586600 {
@@ -590,13 +604,6 @@ def get_collection_items(
590604 'href' : f'{ uri } ?offset={ prev } { serialized_query_params } '
591605 })
592606
593- next_link = False
594-
595- if content .get ('numberMatched' , - 1 ) > (limit + offset ):
596- next_link = True
597- elif len (content ['features' ]) == limit :
598- next_link = True
599-
600607 if next_link :
601608 next_ = offset + limit
602609 next_href = f'{ uri } ?offset={ next_ } { serialized_query_params } '
You can’t perform that action at this time.
0 commit comments