changeset 449:91da42d44ea2

mam: fix `page_max` calculation, thus `complete` attribute
author Goffi <goffi@goffi.org>
date Thu, 22 Apr 2021 18:26:12 +0200
parents c57b9ede1381
children 96059231d58f
files sat_pubsub/mam.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/sat_pubsub/mam.py	Wed Apr 14 13:51:50 2021 +0200
+++ b/sat_pubsub/mam.py	Thu Apr 22 18:26:12 2021 +0200
@@ -116,7 +116,7 @@
                         #      and RSM element data. In this case, we must have the
                         #      "complete"
                         #      attribute set to "true".
-                        page_max = (int(rsm_elt.first['index']) + 1) * mam_request.rsm.max
+                        page_max = int(rsm_elt.first['index']) +  mam_request.rsm.max
                         count = int(str(rsm_elt.count))
                         if page_max >= count:
                             # the maximum items which can be displayed is equal to or