[Enhancement]: Random library sorting #2109

Closed
opened 2026-04-25 00:03:33 +02:00 by adam · 8 comments
Owner

Originally created by @gavinorland on GitHub (Jul 16, 2024).

Describe the Feature/Enhancement

For this issue you introduced the "Discover" feature. Thanks! I think it would still be good, though, if there was a "Randomly" option available for the library sorting menu as well (as I think Plex has, for example).

Why would this be helpful?

This would enable us to see audiobooks we haven't seen for some time, helping us to choose which to play.

Future Implementation (Screenshot)

"Randomly" option would be among the existing options shown in the screenshot.

Audiobookshelf Server Version

2.11.0

Current Implementation (Screenshot)

Sort options
Originally created by @gavinorland on GitHub (Jul 16, 2024). ### Describe the Feature/Enhancement For [this issue](https://github.com/advplyr/audiobookshelf/issues/1240) you introduced the "Discover" feature. Thanks! I think it would still be good, though, if there was a "Randomly" option available for the library sorting menu as well (as I think Plex has, for example). ### Why would this be helpful? This would enable us to see audiobooks we haven't seen for some time, helping us to choose which to play. ### Future Implementation (Screenshot) "Randomly" option would be among the existing options shown in the screenshot. ### Audiobookshelf Server Version 2.11.0 ### Current Implementation (Screenshot) <img width="202" alt="Sort options" src="https://github.com/user-attachments/assets/478daf30-a28d-4ae8-a8b7-1d230005032c">
adam added the enhancement label 2026-04-25 00:03:33 +02:00
adam closed this issue 2026-04-25 00:03:33 +02:00
Author
Owner

@ZLoth commented on GitHub (Jul 21, 2024):

This is something that the Plex media server even uses....

image

@ZLoth commented on GitHub (Jul 21, 2024): This is something that the Plex media server even uses.... ![image](https://github.com/user-attachments/assets/eac92ca0-835f-4a1a-968b-f769e59e5877)
Author
Owner

@gavinorland commented on GitHub (Jul 26, 2024):

@advplyr Many thanks for adding this - and so quickly.

@gavinorland commented on GitHub (Jul 26, 2024): @advplyr Many thanks for adding this - and so quickly.
Author
Owner

@ZLoth commented on GitHub (Jul 26, 2024):

Thank you!

@ZLoth commented on GitHub (Jul 26, 2024): Thank you!
Author
Owner

@github-actions[bot] commented on GitHub (Aug 5, 2024):

Fixed in v2.12.0.

@github-actions[bot] commented on GitHub (Aug 5, 2024): Fixed in [v2.12.0](https://github.com/advplyr/audiobookshelf/releases/tag/v2.12.0).
Author
Owner

@gavinorland commented on GitHub (Aug 6, 2024):

@advplyr Just trying this out (thanks again). It seems to give two different randomised orders when "toggled", but these two never change, even on page refresh. Is that the intended functionality? I thought perhaps it might randomise the view every time that option is selected.

@gavinorland commented on GitHub (Aug 6, 2024): @advplyr Just trying this out (thanks again). It seems to give two different randomised orders when "toggled", but these two never change, even on page refresh. Is that the intended functionality? I thought perhaps it might randomise the view every time that option is selected.
Author
Owner

@advplyr commented on GitHub (Aug 6, 2024):

All of the library API requests are cached for 30 minutes.

The caching system setup right now is very basic. The cache gets cleared if any of the items are updated. This will be improved eventually to only clear what is necessary.

That specific request could probably be setup to skip the cache.

@advplyr commented on GitHub (Aug 6, 2024): All of the library API requests are cached for 30 minutes. The caching system setup right now is very basic. The cache gets cleared if any of the items are updated. This will be improved eventually to only clear what is necessary. That specific request could probably be setup to skip the cache.
Author
Owner

@advplyr commented on GitHub (Aug 7, 2024):

I was wrong about the cache. The 30 minute cache is only applied to the home page shelves. Otherwise the cache remains until something in the database changes.

I made the update so that random sort skips the cache. That makes sense.
Here is the issue for that https://github.com/advplyr/audiobookshelf/issues/3249

@advplyr commented on GitHub (Aug 7, 2024): I was wrong about the cache. The 30 minute cache is only applied to the home page shelves. Otherwise the cache remains until something in the database changes. I made the update so that random sort skips the cache. That makes sense. Here is the issue for that https://github.com/advplyr/audiobookshelf/issues/3249
Author
Owner

@gavinorland commented on GitHub (Aug 7, 2024):

Sounds great, thanks. btw I guess to enable this sorting in the app (as well as in the web UI) a task or issue would need raising in the other repo.

@gavinorland commented on GitHub (Aug 7, 2024): Sounds great, thanks. btw I guess to enable this sorting in the _app_ (as well as in the web UI) a task or issue would need raising in the other repo.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#2109