im new to openstagecontrol but been working with touchOSC for quite a while.
i'm trying to get my resolume thumbnails into the buttons bg with the restapi feature.
if i start resolume before the openstage server everything works fine and my thumbnails getting loaded. but if i update one of my clips the backgrounds wont be loaded again.
is there a way to autorefresh the style css of a button periodically?
We'll use a timestamp in the url to force the browser to redownload the asset then, create a variable widget with the following onCreatescript:
// variable.onCreate
setInterval(()=>{
// update the variable's value periodically
// using current date timestamp
set(this, Date.now())
}, 10000 /* ms*/)
then append the timestamp to the asset url using the inheritance syntax:
If re-downloading every thumbnail periodically is too much, empty the variable's onCreate script, create a button and use its onValue script to update the variable whenever the button is clicked:
// in place of set(this, Date.now())
// replace "this" with the variable's id if calling from a button's onValue (see previous post)
set(this, 0) // make the conditional css empty
setTimeout(()=>{
set(this, 1) // restore it shortly after
}, 1)