Beispiel #1
0
 /**
  * Automatically fixes the shoutzor script
  * This method gets called by shoutzor when blank audio is detected for a prolonged time
  * As the result of some kind of crash (possibly?)
  * @method autofix
  */
 public function autofix($params)
 {
     if ($this->ensureLocalhost() === false) {
         return $this->formatOutput(__('You have no access to this method'), self::METHOD_NOT_AVAILABLE);
     }
     //Prevent the request method from adding the request while we are restarting shoutzor
     $this->shoutzorRunning = false;
     $liquidsoapManager = new LiquidsoapManager();
     $liquidsoapManager->stopScript('shoutzor');
     sleep(5);
     $liquidsoapManager->startScript('shoutzor');
     sleep(1);
     //Get the remaining queue and add them all to shoutzor
     $autoDJ = new AutoDJ();
     $autoDJ->importQueue();
     //Shoutzor is back up and running, requests are now allowed again
     $this->shoutzorRunning = true;
     return $this->formatOutput(true);
 }