Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
WS categories getImages, TotalCount #777
In order to build a paginator in a client using the API of piwigo, the total count of images is required.
We are getting the count of the search result, and this information is redundant because a client can count the results in the response. Ex
Is it possible to include a
added a commit
Sep 30, 2017
I have asked for this more then 1 year and a half ago: http://piwigo.org/forum/viewtopic.php?pid=163539#p163539
Hmm, finally we have total number of unique pictures. I think now we can calculate the correct pagination when getting pictures from a category in recursive mode. I didn't tested yet on galleries that have pictures in multiples categories, but I think this will be fine.
The problem with the modification you made is that you have added this parameter with the same key name like the old one that showed a total different result (the number of images on that request based on "per page" parameter). This was more a lack of a future then a bug. Now what developers will do?
option 1-we must break the compatibility with all version before 2.9.2 ? .... of course this is not possible. We cannot let old versions of piwigo in the air.
Well ... just rename'it "total_count" or something like that. In this way we can check if this new api parameter exist and use new or old method for calculation pagination depending of the Piwigo version.
It remain to you if you let the old "count" also, but like user who reported this said, that "parameter" is redundant . You can always count the number of images by yourself using something like