You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Title was: Add optional seed to /random in api, have webui use it
In the web ui, you access /#random to see a list of random albums, expanding this to /#random-{seed} would make the ui more predictably when going forward and backward in the browser history, allowing you to queue more than one of the albums from the current selection. This could perhaps be done by adding an optional seed query parmaters to the /random api endpoint.
The sqlite query however is a bit more difficult to change because you need a way to make random numbers from a seed, which sqlite does not support.
One option is demonstrated here where they use fancy sql to compute random values. It is however not very clean in my option.
An another option is to implement your own random function in rust and have sqlite use it as shown here with C. I'm not familiar with rust and diesel, but from some quick googling, i determined it should be possible, with lots of nice macros to make the code more easy to read.
The text was updated successfully, but these errors were encountered:
I think this is a valid request, I've ran into this a few times myself too. Note that if you want to queue entire albums from the random view you can drag their cover into the playlist, without leaving the random page.
I don't think either of the two implementation options are very attractive. If/when I look into it, I think I would consider client-side solutions first.
pbsds
changed the title
Add optional seed to /random in api, have webui use it
Store the random selection of albums for navigation in history
Apr 17, 2020
Title was: Add optional seed to
/random
in api, have webui use itIn the web ui, you access
/#random
to see a list of random albums, expanding this to/#random-{seed}
would make the ui more predictably when going forward and backward in the browser history, allowing you to queue more than one of the albums from the current selection. This could perhaps be done by adding an optionalseed
query parmaters to the/random
api endpoint.The sqlite query however is a bit more difficult to change because you need a way to make random numbers from a seed, which sqlite does not support.
One option is demonstrated here where they use fancy sql to compute random values. It is however not very clean in my option.
An another option is to implement your own random function in rust and have sqlite use it as shown here with C. I'm not familiar with rust and diesel, but from some quick googling, i determined it should be possible, with lots of nice macros to make the code more easy to read.
The text was updated successfully, but these errors were encountered: