Page 1 of 1

If-then logic in scheduler

Posted: 31 Jul 2014 14:55
by andrerotgans
Hi Bernd,

Can you help me think about a scenario asked by a local radio station, using Simian at the moment but wanting to switch to PFOA.

Right now they let Simian schedule logs for each hour. But, when a user (DJ) uploads a mp3-file + corresponding .log file, this will overwrite that log for that hour (logs in simian are in a format dayhour.log, ie za18.log for Saturday, 18:00hr)
That log which overwrites the original one will tell Simian to do nothing fancy, it will just play the mentioned mp3 file in that hour. So, all other already scheduled stuff from Simian is discard. So 'overlays' that hour (no regional news, as that is scheduled from within the log, a different approach than PFOA)

They would very much like to keep this. I told them that it is no problem to adjust the scheduler and tell PFOA to just play a MP3 file instead of playing a script for non stop music. But, they rather don't want users to mess with the scheduler (and also don't want them to have to call a superuser to change the schedule). Also, that will not fix the 'no overlays during that hour', the user has to tell that to PFOA manually (from within the overlay scheduler)

I can't seem to see a way in PFOA (at the moment, that is) to do this. in short you want to let the scheduler check for a certain MP3-file in a certain place with a name following a certain convention, if it's there it would fire a different script than the non-stop-music one. It also has to tell PFOA to discard (certain !) overlays, not all (commercials at the beginning and end of the hour still have to be played). The script then has to load and play the mp3 mentioned in the if-then construction....

I'll tell them that it's not possible right now, or do I overlook something ?

Kind regards,

André

Re: If-then logic in scheduler

Posted: 31 Jul 2014 20:47
by radio42
Yes PF can almost do the same, as you can define so called program conditions.
E.g if a file exists execute a different script as if the file would not exist.
See here for details:
viewtopic.php?f=4&t=1016

Re: If-then logic in scheduler

Posted: 31 Jul 2014 20:55
by andrerotgans
Ok, I'm going to have a look into that. Still seems like a bit of creative scripting/configuring ie to discard overlays for the hour coming up, but I'll give it a try !