Skip to content

Conversation

@Servbot91
Copy link
Contributor

If no sort field is specified in GraphQL the server defaults to date created (descending). This incorrectly weighs the random sort results which creates bias towards newer content.

Adding the random sort field corrects this.

If no sort field is specified in GraphQL the server defaults to date created (descending). This incorrectly weighs the random sort results which creates bias towards newer content. 

Adding the random sort field corrects this.
@Servbot91
Copy link
Contributor Author

Tested locally without issue. I used the date created field for verification. Before, it heavily favors newer dates. With this change it seems to be truly random now.

@DogmaDragon DogmaDragon changed the title Correct random sort logic [RandomButton] Correct random sort logic Dec 29, 2025
@DogmaDragon DogmaDragon added the type:plugin Plugins label Dec 29, 2025
@DogmaDragon DogmaDragon merged commit b470716 into stashapp:main Dec 29, 2025
@discourse-stashapp
Copy link

This pull request has been mentioned on Stash. There might be relevant details there:

https://discourse.stashapp.cc/t/randombutton/1809/9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants