DiceR(oll) - A randomizer with local cache to prevent repetition and encourage discovery

:placard: Summary Randomizer with logic to prevent repetition until exhaustion and include new content while actively maintaining list integrity.
:link: Repository https://github.com/Servbot91/DiceR/tree/main/plugins/DiceR
:information_source: Source URL https://raw.githubusercontent.com/Servbot91/DiceR/refs/heads/main/plugins/manifest.yml
:open_book: Install How to install a plugin?

DiceR

DiceR(oll) is an improvement on the original Stash plugin random button written by MrDocSabio. It seemed to make more sense to me to do my own rather than hijack his repo.

Features

  1. Random Item Selection:

    • DiceR fetches all IDs of the current entity type via GraphQL query. It’ll then randomly sort and select.
  2. Better Randomization

    • Shuffles the IDs and selects the next random ID. Supercedes any sort bias when calling randomGlobal().
    • Uses localStorage to store shuffled ID lists and remaining IDs. A major improvement over the original which would inevitably show the same content session to session.
    • Once all items have been shown, the list reshuffles automatically.
    • Works globally (all Scenes, performers, etc.)
  3. New Content Handling

    • It compares the freshly fetched list (currentIds) with the stored cache (stored.allIds) using arraysEqual(). If the IDs have changed (i.e., new content has been added or some items removed), the cache is considered invalid.
    • When the cache is invalid, a new shuffled list of IDs is created and the remaining list is reset so the new content is included in upcoming random selections.
    • DiceR still tracks which items have already been shown from the shuffled list thus preventing repeat selections.
  4. Logging

    • You can verify the state of your local cached list via the F12 browser console menu. All functions are fully logged and color coded to assist with debug.

Installation

  1. Settings β†’ Plugins β†’ Available Plugins
  2. Add Source β†’ Name: DiceR
  3. Source URL: https://raw.githubusercontent.com/Servbot91/DiceR/refs/heads/main/plugins/manifest.yml
  4. Click checkbox, Install
  5. Reload Plugins

Release Notes

Screenshots

Screenshot 2026-02-12 141956
Screenshot 2026-02-12 141924

Credit

random button written by MrDocSabio.

2 Likes