CC-3448: Cancel show shouldn't send "cancel show" msg to pypo anymore
-done
This commit is contained in:
parent
5a7a502d45
commit
22cc362f1c
|
@ -778,15 +778,13 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$showInstance = new Application_Model_ShowInstance($showInstanceId);
|
$showInstance = new Application_Model_ShowInstance($showInstanceId);
|
||||||
}
|
} catch(Exception $e) {
|
||||||
catch(Exception $e){
|
|
||||||
$this->view->show_error = true;
|
$this->view->show_error = true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$show = new Application_Model_Show($showInstance->getShowId());
|
$show = new Application_Model_Show($showInstance->getShowId());
|
||||||
|
|
||||||
$show->cancelShow($showInstance->getShowInstanceStart());
|
$show->cancelShow($showInstance->getShowInstanceStart());
|
||||||
|
|
||||||
$this->view->show_id = $showInstance->getShowId();
|
$this->view->show_id = $showInstance->getShowId();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -806,8 +804,8 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
}
|
}
|
||||||
$showInstance->clearShow();
|
$showInstance->clearShow();
|
||||||
$showInstance->delete();
|
$showInstance->delete();
|
||||||
// send 'cancel-current-show' command to pypo
|
|
||||||
Application_Model_RabbitMq::SendMessageToPypo("cancel_current_show", array());
|
Application_Model_RabbitMq::PushSchedule();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -199,9 +199,6 @@ class Application_Model_Show {
|
||||||
->filterByDbShowId($this->_showId)
|
->filterByDbShowId($this->_showId)
|
||||||
->update(array('DbLastShow' => $timeinfo[0]));
|
->update(array('DbLastShow' => $timeinfo[0]));
|
||||||
|
|
||||||
//$sql = "DELETE FROM cc_show_instances
|
|
||||||
// WHERE starts >= '{$day_timestamp}' AND show_id = {$this->_showId}";
|
|
||||||
|
|
||||||
$sql = "UPDATE cc_show_instances
|
$sql = "UPDATE cc_show_instances
|
||||||
SET modified_instance = TRUE
|
SET modified_instance = TRUE
|
||||||
WHERE starts >= '{$day_timestamp}' AND show_id = {$this->_showId}";
|
WHERE starts >= '{$day_timestamp}' AND show_id = {$this->_showId}";
|
||||||
|
|
|
@ -82,9 +82,6 @@ class PypoFetch(Thread):
|
||||||
elif command == 'update_station_name':
|
elif command == 'update_station_name':
|
||||||
self.logger.info("Updating station name...")
|
self.logger.info("Updating station name...")
|
||||||
self.update_liquidsoap_station_name(m['station_name'])
|
self.update_liquidsoap_station_name(m['station_name'])
|
||||||
elif command == 'cancel_current_show':
|
|
||||||
self.logger.info("Cancel current show command received...")
|
|
||||||
self.stop_current_show()
|
|
||||||
elif command == 'switch_source':
|
elif command == 'switch_source':
|
||||||
self.logger.info("switch_on_source show command received...")
|
self.logger.info("switch_on_source show command received...")
|
||||||
self.switch_source(m['sourcename'], m['status'])
|
self.switch_source(m['sourcename'], m['status'])
|
||||||
|
@ -152,22 +149,7 @@ class PypoFetch(Thread):
|
||||||
self.logger.debug('switch_status:%s',switch_status)
|
self.logger.debug('switch_status:%s',switch_status)
|
||||||
for k, v in switch_status['status'].iteritems():
|
for k, v in switch_status['status'].iteritems():
|
||||||
self.switch_source(k, v)
|
self.switch_source(k, v)
|
||||||
|
|
||||||
def stop_current_show(self):
|
|
||||||
self.logger.debug('Notifying Liquidsoap to stop playback.')
|
|
||||||
|
|
||||||
self.telnet_lock.acquire()
|
|
||||||
try:
|
|
||||||
tn = telnetlib.Telnet(LS_HOST, LS_PORT)
|
|
||||||
tn.write('source.skip\n')
|
|
||||||
tn.write('exit\n')
|
|
||||||
tn.read_all()
|
|
||||||
except Exception, e:
|
|
||||||
self.logger.debug(e)
|
|
||||||
self.logger.debug('Could not connect to liquidsoap')
|
|
||||||
finally:
|
|
||||||
self.telnet_lock.release()
|
|
||||||
|
|
||||||
def regenerateLiquidsoapConf(self, setting_p):
|
def regenerateLiquidsoapConf(self, setting_p):
|
||||||
existing = {}
|
existing = {}
|
||||||
# create a temp file
|
# create a temp file
|
||||||
|
|
|
@ -70,9 +70,6 @@ class PypoMessageHandler(Thread):
|
||||||
elif command == 'update_station_name':
|
elif command == 'update_station_name':
|
||||||
self.logger.info("Updating station name...")
|
self.logger.info("Updating station name...")
|
||||||
self.pypo_queue.put(message)
|
self.pypo_queue.put(message)
|
||||||
elif command == 'cancel_current_show':
|
|
||||||
self.logger.info("Cancel current show command received...")
|
|
||||||
self.pypo_queue.put(message)
|
|
||||||
elif command == 'switch_source':
|
elif command == 'switch_source':
|
||||||
self.logger.info("switch_source command received...")
|
self.logger.info("switch_source command received...")
|
||||||
self.pypo_queue.put(message)
|
self.pypo_queue.put(message)
|
||||||
|
|
|
@ -270,6 +270,7 @@ class PypoPush(Thread):
|
||||||
self.telnet_lock.acquire()
|
self.telnet_lock.acquire()
|
||||||
tn = telnetlib.Telnet(LS_HOST, LS_PORT)
|
tn = telnetlib.Telnet(LS_HOST, LS_PORT)
|
||||||
msg = "queue.remove %s\n" % queue_id
|
msg = "queue.remove %s\n" % queue_id
|
||||||
|
self.logger.debug(msg)
|
||||||
tn.write(msg)
|
tn.write(msg)
|
||||||
response = tn.read_until("\r\n").strip("\r\n")
|
response = tn.read_until("\r\n").strip("\r\n")
|
||||||
|
|
||||||
|
@ -278,8 +279,9 @@ class PypoPush(Thread):
|
||||||
Cannot remove because Liquidsoap started playing the item. Need
|
Cannot remove because Liquidsoap started playing the item. Need
|
||||||
to use source.skip instead
|
to use source.skip instead
|
||||||
"""
|
"""
|
||||||
msg = "source.skip"
|
msg = "source.skip\n"
|
||||||
tn.write("source.skip")
|
self.logger.debug(msg)
|
||||||
|
tn.write(msg)
|
||||||
|
|
||||||
tn.write("exit\n")
|
tn.write("exit\n")
|
||||||
tn.read_all()
|
tn.read_all()
|
||||||
|
|
Loading…
Reference in New Issue