From 1158fc2c9e5046d657f22cd8e6681fc5d92fc506 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Thu, 25 Apr 2013 22:38:06 -0400 Subject: [PATCH 1/3] more legible comment --- python_apps/pypo/media/update/replaygainupdater.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python_apps/pypo/media/update/replaygainupdater.py b/python_apps/pypo/media/update/replaygainupdater.py index daf63d54d..c1123f4a8 100644 --- a/python_apps/pypo/media/update/replaygainupdater.py +++ b/python_apps/pypo/media/update/replaygainupdater.py @@ -11,7 +11,7 @@ class ReplayGainUpdater(Thread): """ The purpose of the class is to query the server for a list of files which do not have a ReplayGain value calculated. This class will iterate over the - list calculate the values, update the server and repeat the process until + list, calculate the values, update the server and repeat the process until the server reports there are no files left. This class will see heavy activity right after a 2.1->2.2 upgrade since 2.2 From d902d38429f8c6cd2a26d9073b0504c8d7b8a967 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Thu, 2 May 2013 17:50:36 -0400 Subject: [PATCH 2/3] revert jsonEncode change not supported by older zend versions --- airtime_mvc/application/controllers/ApiController.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/airtime_mvc/application/controllers/ApiController.php b/airtime_mvc/application/controllers/ApiController.php index 1a810ebc5..8c767c0e0 100644 --- a/airtime_mvc/application/controllers/ApiController.php +++ b/airtime_mvc/application/controllers/ApiController.php @@ -288,7 +288,7 @@ class ApiController extends Zend_Controller_Action //used by caller to determine if the airtime they are running or widgets in use is out of date. $result['AIRTIME_API_VERSION'] = AIRTIME_API_VERSION; - header("Content-type: text/javascript"); + header("Content-Type: application/json"); // If a callback is not given, then just provide the raw JSON. echo isset($_GET['callback']) ? $_GET['callback'].'('.json_encode($result).')' : json_encode($result); @@ -348,11 +348,14 @@ class ApiController extends Zend_Controller_Action public function scheduleAction() { - $data = Application_Model_Schedule::getSchedule(); + $this->view->layout()->disableLayout(); + $this->_helper->viewRenderer->setNoRender(true); + header("Content-Type: application/json"); - $data = json_encode($data, JSON_FORCE_OBJECT); - $this->_helper->json->sendJson($data, false, true); + $data = Application_Model_Schedule::getSchedule(); + + echo json_encode($data, JSON_FORCE_OBJECT); } public function notifyMediaItemStartPlayAction() From 84efb4a9b7a1b5e48565499679c9b3e3823bbd3b Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Thu, 2 May 2013 17:59:03 -0400 Subject: [PATCH 3/3] work around to work with annoying static methods - should remove these later.. --- python_apps/pypo/pypofetch.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/python_apps/pypo/pypofetch.py b/python_apps/pypo/pypofetch.py index edb6f7d37..e0abeb317 100644 --- a/python_apps/pypo/pypofetch.py +++ b/python_apps/pypo/pypofetch.py @@ -36,15 +36,20 @@ signal.signal(signal.SIGINT, keyboardInterruptHandler) POLL_INTERVAL = 1800 +config_static = None + class PypoFetch(Thread): def __init__(self, pypoFetch_q, pypoPush_q, media_q, telnet_lock, pypo_liquidsoap, config): Thread.__init__(self) + global config_static + self.api_client = api_client.AirtimeApiClient() self.fetch_queue = pypoFetch_q self.push_queue = pypoPush_q self.media_prepare_queue = media_q self.last_update_schedule_timestamp = time.time() self.config = config + config_static = config self.listener_timeout = POLL_INTERVAL self.telnet_lock = telnet_lock @@ -134,7 +139,7 @@ class PypoFetch(Thread): try: lock.acquire() - tn = telnetlib.Telnet(self.config['ls_host'], self.config['ls_port']) + tn = telnetlib.Telnet(config_static['ls_host'], config_static['ls_port']) logger.info(command) tn.write(command) tn.write('exit\n') @@ -149,7 +154,7 @@ class PypoFetch(Thread): try: lock.acquire() - tn = telnetlib.Telnet(self.config['ls_host'], self.config['ls_port']) + tn = telnetlib.Telnet(config_static['ls_host'], config_static['ls_port']) for i in commands: logger.info(i) tn.write(i)