Hi,
But it adds a random song to the current playlist everytime and songs are twice on the playlist after that.
This is exactly what it is made for (see
here).
A very dirty but working hack:
Edit "/srv/http/command/rune_SY_wrk"
// mount all sources
if ($all_mounted === 0) {
runelog('wrk_SY: try to mount all shares!');
$all_mounted = wrk_sourcemount($redis, 'mountall');
if ($all_mounted === 1) {
runelog('wrk_SY: all shares mounted successfully!');
} else {
$retries_mounting++;
runelog('wrk_SY: error mounting shares, try it again! Count: '.$retries_mounting);
if ($retries_mounting > 20) {
$all_mounted = 1;
runelog('wrk_SY: mounting: tried it 20 times (10 seconds) => capitulating!');
ui_notify_async('ERROR','Failed to mount network shares');
}
usleep(500000);
}
}
to
// mount all sources
if ($all_mounted === 0) {
runelog('wrk_SY: try to mount all shares!');
$all_mounted = wrk_sourcemount($redis, 'mountall');
if ($all_mounted === 1) {
runelog('wrk_SY: all shares mounted successfully!');
sysCmdAsync("mpc load your-playlist-name; mpc play");
} else {
$retries_mounting++;
runelog('wrk_SY: error mounting shares, try it again! Count: '.$retries_mounting);
if ($retries_mounting > 20) {
$all_mounted = 1;
runelog('wrk_SY: mounting: tried it 20 times (10 seconds) => capitulating!');
ui_notify_async('ERROR','Failed to mount network shares');
}
usleep(500000);
}
}
The best would have been to get a script started with crontab to start the playlist, but don't know to start the playlist with a script.
This is hard to do, because you have to wait until all is up and running (e.g. shares have to be mounted).
Frank