Page MenuHomePhabricator

Add an option to sort list of books in a randomized manner
Closed, ResolvedPublicFeature

Description

Currently, the list of books are sorted in the Wikisource reader app based on the pageviews data denoting their popularity and alphabetically. Books can also be sorted in a randomized manner, so that users can get a chance to find the books which are somewhere in the middle of these lists

The randomised sorting should be made possible from the wsindex API and then the sorting option should be visible in UI.

In the sort options, there should be an extra way to sort i.e. randomised sort. More options can come in future

Event Timeline

@Saiphani02, I have implemented this by adding the default sort to random unless you specify either to sort alphabetically or by priority. Here is the PR kindly check.

https://codeberg.org/ph4ni/wsindex/pulls/10

Random sort should be added as an additional sort key. Should not alter the current default sorting behaviour of popularity. In the app, another sort option should be added for "Random".

I have altered the api to sort randomly if no sort is added as the client side by default sends a sort query. This doesn't affect the fetching by popularity in the first fetch as it will have that query.

Hi @Saiphani02, I have re looked this as mentioned please check, https://codeberg.org/ph4ni/wsindex/pulls/10 .

I'll go a head to adding random choice to client side.

Can you rename the text to just "Random" instead of "Randomised Sort"? I've merged the random sort on the API side so you can test.

Also, I've created a task for making these strings translatable. See T412982

I have renamed and it works fine but just a concern, Once you switch to random sort it will fetch random books and cache them. Is that fine?

Yeah it is normal. Merged