Return album photo sort order with API pwg.categories.getList #820

Closed
opened 2026-10-05 00:19:02 +02:00 by adam · 8 comments
Owner

The pwg.categories.getList method does not return the album photo sort order choosen by the user with the web UI and stored on the server, preventing external apps to adopt it. Could this be implemented as requested here ?

The `pwg.categories.getList` method does not return the album photo sort order choosen by the user with the web UI and stored on the server, preventing external apps to adopt it. Could this be implemented as requested [here](https://github.com/Piwigo/Piwigo-Mobile/issues/242) ? <!-- github-sync-id:352072008 -->
adam closed this issue 2026-10-05 00:19:02 +02:00
Author
Owner

Hello, I don't understand why you would need to get the rank because we can already get the global rank therefore the rank. The global rank contains the rank. It is the last number of the global rank.

For example, if you're global rank is this : 1.2.10
Then the rank is : 10

However the idea of adding a function to set the rank through the API is good. So please open a issue.

Hello, I don't understand why you would need to get the rank because we can already get the global rank therefore the rank. The global rank contains the rank. It is the last number of the global rank. For example, if you're global rank is this : 1.2.10 Then the rank is : 10 However the idea of adding a function to set the rank through the API is good. So please open a issue. <!-- github-comment-id:452734961 -->
Author
Owner

Ok, sorry I see the #918 .

Ok, sorry I see the #918 . <!-- github-comment-id:452741368 -->
Author
Owner

@EddyLB I would like your feeling about the answer of @Teatek : why do you need the rank when you already have the global_rank?

@Teatek has pushed a pull-request #955 which adds the rankin the output of method pwg.categories.getList and pwg.categories.getAdminList but I fear that some 3rd part apps are expecting N fields and if they receive N+1 it breaks their execution. If we can avoid this change, I would be "more relaxed" :-)

@EddyLB I would like your feeling about the answer of @Teatek : why do you need the `rank` when you already have the `global_rank`? @Teatek has pushed a pull-request #955 which adds the `rank`in the output of method `pwg.categories.getList` and `pwg.categories.getAdminList` but I fear that some 3rd part apps are expecting N fields and if they receive N+1 it breaks their execution. If we can avoid this change, I would be "more relaxed" :-) <!-- github-comment-id:459667522 -->
Author
Owner

@plegall I guess there is some misunderstanding and the pull-request #955 I apologise if
https://github.com/Piwigo/Piwigo-Mobile/issues/242 is unclear.

To my knowledge, a Piwigo server provides the order in which albums appear on the web interface with global_rank but not the option selected by the user for sorting photos inside each album (option set with the web interface in section Albums / Manage / Photos sort order). That is why I opened this issue.

Similarly, #918 requests the possibility to change that option from a third party app so that users get the same photos sort order when returning to the web interface.

@plegall I guess there is some misunderstanding and the pull-request #955 I apologise if https://github.com/Piwigo/Piwigo-Mobile/issues/242 is unclear. To my knowledge, a Piwigo server provides the order in which albums appear on the web interface with `global_rank` but not the option selected by the user for sorting photos inside each album (option set with the web interface in section Albums / Manage / Photos sort order). That is why I opened this issue. Similarly, #918 requests the possibility to change that option from a third party app so that users get the same photos sort order when returning to the web interface. <!-- github-comment-id:459970161 -->
Author
Owner

Allright, my mistake, I understood wrong :-)

Allright, my mistake, I understood wrong :-) <!-- github-comment-id:460065419 -->
Author
Owner

@EddyLB is this issue fixed?

@EddyLB is this issue fixed? <!-- github-comment-id:1620422026 -->
Author
Owner

@plegall , I have implemented the code shown in the commits in a test server in version 13.7.0 and this works well. The method returns in addition for example: "image_order":"date_creation ASC, file ASC, id ASC".

PS: Returning additional data is not an issue for routines parsing JSON data.

@plegall , I have implemented the code shown in the commits in a test server in version 13.7.0 and this works well. The method returns in addition for example: "image_order":"date_creation ASC, file ASC, id ASC". PS: Returning additional data is not an issue for routines parsing JSON data. <!-- github-comment-id:1620661741 -->
Author
Owner

OK, I've adapted the pull-request to recent code changes in pwg.categories.getAdminList and pwg.categories.getList and merged it.

OK, I've adapted the pull-request to recent code changes in `pwg.categories.getAdminList` and `pwg.categories.getList` and merged it. <!-- github-comment-id:1621353528 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#820