aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mastodon')
-rw-r--r--mastodon/Mastodon.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py
index 0304b8f..0922a6f 100644
--- a/mastodon/Mastodon.py
+++ b/mastodon/Mastodon.py
@@ -3497,6 +3497,11 @@ class Mastodon:
3497 del next_params['min_id'] 3497 del next_params['min_id']
3498 response._pagination_next = next_params 3498 response._pagination_next = next_params
3499 3499
3500 # Maybe other API users rely on the pagination info in the last item
3501 # Will be removed in future
3502 if isinstance(response[-1], AttribAccessDict):
3503 response[-1]._pagination_next = next_params
3504
3500 if url['rel'] == 'prev': 3505 if url['rel'] == 'prev':
3501 # Be paranoid and extract since_id or min_id specifically 3506 # Be paranoid and extract since_id or min_id specifically
3502 prev_url = url['url'] 3507 prev_url = url['url']
@@ -3515,7 +3520,12 @@ class Mastodon:
3515 if "max_id" in prev_params: 3520 if "max_id" in prev_params:
3516 del prev_params['max_id'] 3521 del prev_params['max_id']
3517 response._pagination_prev = prev_params 3522 response._pagination_prev = prev_params
3518 3523
3524 # Maybe other API users rely on the pagination info in the first item
3525 # Will be removed in future
3526 if isinstance(response[0], AttribAccessDict):
3527 response[0]._pagination_prev = prev_params
3528
3519 # New and fantastico (post-2.6.0): min_id pagination 3529 # New and fantastico (post-2.6.0): min_id pagination
3520 matchgroups = re.search(r"[?&]min_id=([^&]+)", prev_url) 3530 matchgroups = re.search(r"[?&]min_id=([^&]+)", prev_url)
3521 if matchgroups: 3531 if matchgroups:
@@ -3531,6 +3541,11 @@ class Mastodon:
3531 del prev_params['max_id'] 3541 del prev_params['max_id']
3532 response._pagination_prev = prev_params 3542 response._pagination_prev = prev_params
3533 3543
3544 # Maybe other API users rely on the pagination info in the first item
3545 # Will be removed in future
3546 if isinstance(response[0], AttribAccessDict):
3547 response[0]._pagination_prev = prev_params
3548
3534 return response 3549 return response
3535 3550
3536 def __get_streaming_base(self): 3551 def __get_streaming_base(self):
Powered by cgit v1.2.3 (git 2.41.0)