From ca6fd4b9ee1c84ad8e8b6ff4404b49b0f4dfdd0d Mon Sep 17 00:00:00 2001 From: lukabazuka Date: Wed, 23 Mar 2011 18:19:53 +0100 Subject: [PATCH 1/4] Issue CC-2063 resolved --- public/css/images/icon_rebroadcast.png | Bin 0 -> 1075 bytes public/css/images/icon_record.png | Bin 0 -> 1080 bytes public/css/styles.css | 21 ++++++++++++++++----- 3 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 public/css/images/icon_rebroadcast.png create mode 100644 public/css/images/icon_record.png diff --git a/public/css/images/icon_rebroadcast.png b/public/css/images/icon_rebroadcast.png new file mode 100644 index 0000000000000000000000000000000000000000..5282d87b2aba3ae5ae60e122f5d1b77c4c42cb27 GIT binary patch literal 1075 zcmbVLO=#0l9M33>Z8#8gFvo;P=0#bPm!#=Owrp#g%oXf5x`G7}mL_j&*pe5MH=7m3 z;!Z*@g5be}mt92gAb1!a1QBF-@uqke1`|B(B#1Blm>$Xw29o!Y-|zSTezdxLeRO1E zgkhM`!je{^>ll4Uh6d^P*3+@Cbh$+I3R%M&q;B|#$y&IIK*2FKQ3)B=?wvz4%P=v^ zE>}pUctbI={xd@A19@XrnhL6@7 z%Vo2%Wo9gPeh$or3Keh=F+k{SyMYp_Y+F~M`{Jo?j zOveeT~2#!}Qo(j7`H&HZY zd}w&Qz(L+|qPW`VfRxZ*H~ON3@~(&Y5(@B+Z_;{fO!de#cV`=lfYcjh#kXlujBO2@ zI}UP5K~q`!hqG);$>>rpk)u%yazclKkQH-DEuGeK8cgZwjMUTU$IVJYn!+VnPUZzc zhiNejwMALXrBh-;7R4U7;0DBSP1Lh%Q@dTRcqUiL`^X^JFJrvj>wwi7COD{J59HTm zaMN}zTo0n+bYj(zZ{J1MqK_TW&aPtjv7XTc4NBQWGA+yfqwa96|H&9no#CU__@`BR zSG514?P=rF!|CWCm(Gh%2SfdkJ)uKI^OY@!->U1)W&`|Q8QNn8yn4j!4_-e1UA@QYUp~HHxY9frfA;e8z=hawb39f^KB;{g)-N8+ ofop}w&Epr2cmL|lOl+Y!z)Wioe%zK{A4X$b(3iDWx%G#C0D9(6HUIzs literal 0 HcmV?d00001 diff --git a/public/css/images/icon_record.png b/public/css/images/icon_record.png new file mode 100644 index 0000000000000000000000000000000000000000..ffedeb5c12ed33368016ea3f435956de0fc28332 GIT binary patch literal 1080 zcmbVLO=#0l91jj{h$N3Zj@LZ)>(CFH7FmY~W=e zDxT(Lmw~8XSi?8=NxMq8E#xEfs&I$b+fSKqOqls zs=hR%rwnfR44d|4Dqta^vA#8Hd$OP5TDmgb2iH8uwjg9C!|gg%E0x(Cb`dK@Kv)NH zz{Z7$5RD}giBqfy1i%B47sRlTkfWju0NZ{zYRxq!sG|Upr@N*@Ol-4(qBeo&Nrt1I?uKAFrP7|T?X?p{ zQ^xz6!wV6>TUHQP3+<5#`s+qlv{zkp5MMzao_BRxkIA79ndWYPLjjO_BagZ!Es8b^ zu|97hn-pP&qkkfXX~-!xs>Bo;wIIb*AP8AeiNjpWGdRx=*CrI`FK15p(Mp~ zf}nyVkf4$Tc~MnTk{E>@ZqfFLX6vY9*Q9pa+}yrgIp-pcV7H3#Y^MXtbxg2V#}1nt zlh|?7HgLlWinALlM6S7jjJ%62wv}Dk>|#9y1qh3#Gr-!}KK{lNimk!38+vy!TRMSP6t@`gbD%+t=wl_WW`R0!=>&++kk8bU3 z_GDk59_{rv#|sL$b?_Q^y4AO`vV8sFhsPQ9YHqN+eDXW|^>ylST>F^ME9=|EXP550 xdNjSUcID#v-^ZGI(_c`3uD%@jbWd74aD=&Am@5yyeK8Qsa#0 h3 > span.ui-icon.ui-icon-triangle-1-e, #schedule_playlist_chosen li > h3 > span.ui-icon.ui-icon-triangle-1-s { float:left; - margin-right: 8px; } #schedule_playlist_chosen li > h3 > span.ui-icon.ui-icon-close { @@ -1474,9 +1473,21 @@ ul.errors li { margin:-4px 3px -3px 0; float:right; } - .time-flow { - float:right; - margin-right:4px; + float:right; + margin-right:4px; } - +.small-icon { + display:block; + width:21px; + height:10px; + float:right; + margin-left:3px; +} +.small-icon.recording { + background:url(images/icon_record.png) no-repeat 0 0; +} +.small-icon.rebroadcast { + background:url(images/icon_rebroadcast.png) no-repeat 0 0; +} + \ No newline at end of file From d982419b164c08d103ef428007e7c9d06b42397c Mon Sep 17 00:00:00 2001 From: martin Date: Wed, 23 Mar 2011 13:43:11 -0400 Subject: [PATCH 2/4] CC-1894: Warn users about time zone differences or clock drift problems on the server -An error msg now appears in pypo log when pypo and server timezones do not match --- application/models/Schedule.php | 1 + pypo/pypofetch.py | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/application/models/Schedule.php b/application/models/Schedule.php index 21419c4f0..dd3555a26 100644 --- a/application/models/Schedule.php +++ b/application/models/Schedule.php @@ -716,6 +716,7 @@ class Schedule { $result['stream_metadata'] = array(); $result['stream_metadata']['format'] = Application_Model_Preference::GetStreamLabelFormat(); $result['stream_metadata']['station_name'] = Application_Model_Preference::GetStationName(); + $result['server_timezone'] = date_default_timezone_get(); return $result; } diff --git a/pypo/pypofetch.py b/pypo/pypofetch.py index c31bd094a..0313e9567 100644 --- a/pypo/pypofetch.py +++ b/pypo/pypofetch.py @@ -69,13 +69,22 @@ class PypoFetch(Thread): consumer.register_callback(handle_message) consumer.consume() - logger.info("PypoFetch: init complete"); + logger.info("PypoFetch: init complete") def set_export_source(self, export_source): self.export_source = export_source self.cache_dir = config["cache_dir"] + self.export_source + '/' + def check_matching_timezones(self, server_timezone): + logger = logging.getLogger('fetch') + f = open('/etc/timezone', 'r') + pypo_timezone = f.readline().strip(' \t\n\r') + f.close() + if server_timezone != pypo_timezone: + logger.error("Server and pypo timezones do not match. Audio playback may not start when expected!") + logger.error("Server timezone: %s", server_timezone) + logger.error("Pypo timezone: %s", pypo_timezone) """ Process the schedule @@ -88,7 +97,9 @@ class PypoFetch(Thread): def process_schedule(self, schedule_data, export_source): logger = logging.getLogger('fetch') self.schedule = schedule_data["playlists"] - + + self.check_matching_timezones(schedule_data["server_timezone"]) + # Push stream metadata to liquidsoap # TODO: THIS LIQUIDSOAP STUFF NEEDS TO BE MOVED TO PYPO-PUSH!!! stream_metadata = schedule_data['stream_metadata'] From c15c92d855b7e04bfc7c27332e4cf52a0be3745d Mon Sep 17 00:00:00 2001 From: "paul.baranowski" Date: Wed, 23 Mar 2011 17:07:59 -0400 Subject: [PATCH 3/4] Fixed comments for poll_interval value. --- pypo/config.cfg | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pypo/config.cfg b/pypo/config.cfg index b4dc9424e..4fd5ac377 100644 --- a/pypo/config.cfg +++ b/pypo/config.cfg @@ -41,13 +41,11 @@ cache_for = 24 #how long to hold the cache, in hours # Poll interval in seconds. # -# This is how often the poll script downloads new schedules and files from the -# server. +# This will rarely need to be changed because any schedule changes are +# automatically sent to pypo immediately. # -# For production use, this number depends on whether you plan on making any -# last-minute changes to your schedule. This number should be set to half of -# the time you expect to "lock-in" your schedule. So if your schedule is set -# 24 hours in advance, this can be set to poll every 12 hours. +# This is how often the poll script downloads new schedules and files from the +# server in the event that no changes are made to the schedule. # poll_interval = 3600 # in seconds. From d943548f27e042f9729c13f7944e8e83b382de0d Mon Sep 17 00:00:00 2001 From: "paul.baranowski" Date: Wed, 23 Mar 2011 18:16:08 -0400 Subject: [PATCH 4/4] CC-2095: Changes to the stream metadata are not pushed to pypo Fixed. --- application/models/Preference.php | 46 ++++++++++++++++--------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/application/models/Preference.php b/application/models/Preference.php index 6ecc83ae4..8662f4424 100644 --- a/application/models/Preference.php +++ b/application/models/Preference.php @@ -8,30 +8,30 @@ class Application_Model_Preference $auth = Zend_Auth::getInstance(); $id = $auth->getIdentity()->id; - + //Check if key already exists $sql = "SELECT COUNT(*) FROM cc_pref" ." WHERE keystr = '$key'"; $result = $CC_DBC->GetOne($sql); - + if ($result == 1){ $sql = "UPDATE cc_pref" ." SET subjid = $id, valstr = '$value'" - ." WHERE keystr = '$key'"; + ." WHERE keystr = '$key'"; } else { $sql = "INSERT INTO cc_pref (subjid, keystr, valstr)" ." VALUES ($id, '$key', '$value')"; } return $CC_DBC->query($sql); } - + public static function GetValue($key){ global $CC_CONFIG, $CC_DBC; //Check if key already exists $sql = "SELECT COUNT(*) FROM cc_pref" ." WHERE keystr = '$key'"; $result = $CC_DBC->GetOne($sql); - + if ($result == 0) return ""; else { @@ -40,9 +40,9 @@ class Application_Model_Preference $result = $CC_DBC->GetOne($sql); return $result; } - + } - + public static function GetHeadTitle(){ /* Caches the title name as a session variable so we dont access * the database on every page load. */ @@ -55,31 +55,32 @@ class Application_Model_Preference } if (strlen($title) > 0) $title .= " - "; - + return $title."Airtime"; } - + public static function SetHeadTitle($title, $view){ - Application_Model_Preference::SetValue("station_name", $title); - $defaultNamespace = new Zend_Session_Namespace('title_name'); + Application_Model_Preference::SetValue("station_name", $title); + $defaultNamespace = new Zend_Session_Namespace('title_name'); $defaultNamespace->title = $title; - + RabbitMq::PushSchedule(); + //set session variable to new station name so that html title is updated. //should probably do this in a view helper to keep this controller as minimal as possible. $view->headTitle()->exchangeArray(array()); //clear headTitle ArrayObject $view->headTitle(Application_Model_Preference::GetHeadTitle()); } - public static function SetShowsPopulatedUntil($timestamp) { - Application_Model_Preference::SetValue("shows_populated_until", $timestamp); + public static function SetShowsPopulatedUntil($timestamp) { + Application_Model_Preference::SetValue("shows_populated_until", $timestamp); } public static function GetShowsPopulatedUntil() { return Application_Model_Preference::GetValue("shows_populated_until"); } - public static function SetDefaultFade($fade) { - Application_Model_Preference::SetValue("default_fade", $fade); + public static function SetDefaultFade($fade) { + Application_Model_Preference::SetValue("default_fade", $fade); } public static function GetDefaultFade() { @@ -88,6 +89,7 @@ class Application_Model_Preference public static function SetStreamLabelFormat($type){ Application_Model_Preference::SetValue("stream_label_format", $type); + RabbitMq::PushSchedule(); } public static function GetStreamLabelFormat(){ @@ -98,24 +100,24 @@ class Application_Model_Preference return Application_Model_Preference::getValue("station_name"); } - public static function SetDoSoundCloudUpload($upload) { - Application_Model_Preference::SetValue("soundcloud_upload", $upload); + public static function SetDoSoundCloudUpload($upload) { + Application_Model_Preference::SetValue("soundcloud_upload", $upload); } public static function GetDoSoundCloudUpload() { return Application_Model_Preference::GetValue("soundcloud_upload"); } - public static function SetSoundCloudUser($user) { - Application_Model_Preference::SetValue("soundcloud_user", $user); + public static function SetSoundCloudUser($user) { + Application_Model_Preference::SetValue("soundcloud_user", $user); } public static function GetSoundCloudUser() { return Application_Model_Preference::GetValue("soundcloud_user"); } - public static function SetSoundCloudPassword($password) { - Application_Model_Preference::SetValue("soundcloud_password", $password); + public static function SetSoundCloudPassword($password) { + Application_Model_Preference::SetValue("soundcloud_password", $password); } public static function GetSoundCloudPassword() {