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(
580
580
'href' : f'{ uri } ?f={ F_HTML } { serialized_query_params } '
581
581
}])
582
582
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 :
584
598
prev = max (0 , offset - limit )
585
599
content ['links' ].append (
586
600
{
@@ -590,13 +604,6 @@ def get_collection_items(
590
604
'href' : f'{ uri } ?offset={ prev } { serialized_query_params } '
591
605
})
592
606
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
-
600
607
if next_link :
601
608
next_ = offset + limit
602
609
next_href = f'{ uri } ?offset={ next_ } { serialized_query_params } '
You can’t perform that action at this time.
0 commit comments