Use day of month instead of day of week when seeding shuffle.

This commit is contained in:
Bill Thiede 2020-03-14 16:30:44 -07:00
parent f683acf0ae
commit 24240c5f68

View File

@ -45,7 +45,7 @@ const roundup = (v: number, mod: number) => {
* @param {Array} a items An array containing the items. * @param {Array} a items An array containing the items.
*/ */
function shuffle(a: Array<MediaItem>) { function shuffle(a: Array<MediaItem>) {
let rng = new Random(new Date().getDay()); let rng = new Random(new Date().getDate());
for (let i = a.length - 1; i > 0; i--) { for (let i = a.length - 1; i > 0; i--) {
const j = Math.floor(rng.nextFloat() * (i + 1)); const j = Math.floor(rng.nextFloat() * (i + 1));
[a[i], a[j]] = [a[j], a[i]]; [a[i], a[j]] = [a[j], a[i]];