A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.
Read the statement by Michael Teeuw here.
MMM-ImagesPhotos
-
@Nneuland no idea, I use it all the time and have sequential false…
-
@Nneuland how many images?
the algoritm use in IP is
Math.floor(Math.random() * photos.length);
math random is 0-1
math floor rounds up (>0)
it needs an whole number cause there is a 0-(num-1) list of images to pickso the smaller the list the more common the results will be
I have about 150 images
-
I have quite a few images. 260 i think. I suppose i could write a script to rename my images randomly as a work around. but we just curious if anyone has similar issues.
thanks
-
@Nneuland has nothing to do with the names…
its purely count
you could write quick js to test the results with 260 images
let num_images=260 const generate = () => Math.floor(Math.random() * num_images); let hash={} for(let i =0; i<num_images; i++){ let t=generate() console.log("iteration ",i ," index ",t ) if(hash[t]===undefined) hash[t]=0 hash[t]++ } console.log("starting hash dump") for(let i =0; i<num_images; i++){ if(hash[i] === undefined) console.log("found unused at "+i) else if(hash[i]===1) console.log("found 1 use at "+i) else if(hash[i]>1) console.log("found recurring at "+i) } console.log("done with hash dump")
there were dups, and unused
-
@sdetweil I’ll try that out. Thank you Sam!