Sibusten / derpibooru-downloader

A downloader for imageboards running Philomena, such as Derpibooru.
MIT License
62 stars 6 forks source link

Preserving order in randomly sorted searches #1

Closed DoublePipe closed 7 years ago

DoublePipe commented 7 years ago

Note that there is no (known) way to preserve the order of images when using Random, so only one page can be guaranteed to be truly random.

Hi! I'm a Derpibooru site developer, and recently pushed an update to resolve this. To get a predictable order in a random search, you can now provide a numeric seed in the sf-argument like so:

sf=random:7213143

Another seed will produce a different but consistent order.

Sibusten commented 7 years ago

Oh, hello. Kind of surprised anyone found this, let alone a developer, ha. Thanks for taking a look and the feedback. I had thought about making some kind of post on the forum but had shied away from it

I'll add a random seed to the end of it if 'random' is chosen. I'm not sure if having the ability for the user to provide the seed is needed as it's kind of meant to be random and it would require a whole new text field. So I'll stick with this for now.

Also, it appears that the site can throw an error if the provided number is too large. For example: https://derpibooru.org/search.json?q=fs&sd=desc&sf=random:9999999999999999999 I can't say if this is the intended failure or if another way of handling it would be preferred (truncating the number, modding it, or just capping it)

Sibusten commented 7 years ago

Implemented, new version up. Should be working as intended now