Closed DarthNerdus closed 7 months ago
Thank you ! That looks cool. Give me a few days to review it please.
Awesome! I just pushed a small change to remove the pagination from the Random page--a single set is all that's needed as it randomly regenerates every reload.
I further reverted the PageRequest
changes as the paginator is suppressed on the Random page anyways. This cleans up the changes.
We will need tests for the backend here as well.
I'm curious -- how would you propose that? We'd need to populate the test harness DB with multiple books and can query them, but there's always the risk that two concurrent requests return the same result set/order (especially if there's a small number of results).
I'm happy to implement something, but testing a Random sortby will require a lot more standup and there is always that chance. I can't think of anything that wouldn't be mitigating a low chance that the test fails -- which will always be there.
For this use case I would go for the sanity check rather than testing that we actually get random results. We want to make sure we get a list of results even when we use the random function. This is to make sure that if one day a breaking change happens in the Exposed framework for example we have a test that will fail. That would be enough for me in this situation. What do you think of that ?
That's reasonable -- I'll look to mock that in tonight.
Alright, tests are up!
:tada: This PR is included in version 0.56.0 :tada:
The release is available on:
v0.56.0
Your semantic-release bot :package::rocket:
Inspired by the "Random" page segment in Calibre-Web, I really enjoy rediscovering items in my list randomly. To that end, this PR implements "Random" sort.
parseSort
method and directly apply the sort order