diff --git a/airtime_mvc/application/forms/GeneralPreferences.php b/airtime_mvc/application/forms/GeneralPreferences.php index 1514e1460..7bbb1784f 100644 --- a/airtime_mvc/application/forms/GeneralPreferences.php +++ b/airtime_mvc/application/forms/GeneralPreferences.php @@ -71,8 +71,10 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm 'Africa' => DateTimeZone::AFRICA, 'America' => DateTimeZone::AMERICA, 'Antarctica' => DateTimeZone::ANTARCTICA, + 'Arctic' => DateTimeZone::ARCTIC, 'Asia' => DateTimeZone::ASIA, 'Atlantic' => DateTimeZone::ATLANTIC, + 'Australia' => DateTimeZone::AUSTRALIA, 'Europe' => DateTimeZone::EUROPE, 'Indian' => DateTimeZone::INDIAN, 'Pacific' => DateTimeZone::PACIFIC diff --git a/airtime_mvc/application/layouts/scripts/bare.phtml b/airtime_mvc/application/layouts/scripts/bare.phtml index 43c42463c..b89443505 100644 --- a/airtime_mvc/application/layouts/scripts/bare.phtml +++ b/airtime_mvc/application/layouts/scripts/bare.phtml @@ -5,6 +5,7 @@ Live stream headScript() ?> headLink() ?> + google_analytics)?$this->google_analytics:"" ?>
layout()->content ?>
diff --git a/airtime_mvc/application/layouts/scripts/layout.phtml b/airtime_mvc/application/layouts/scripts/layout.phtml index 53ff557d1..10e6a5ec9 100644 --- a/airtime_mvc/application/layouts/scripts/layout.phtml +++ b/airtime_mvc/application/layouts/scripts/layout.phtml @@ -5,6 +5,7 @@ headTitle() ?> headScript() ?> headLink() ?> + google_analytics)?$this->google_analytics:"" ?> diff --git a/airtime_mvc/application/layouts/scripts/library.phtml b/airtime_mvc/application/layouts/scripts/library.phtml index 1241dfb50..b2982c1f4 100644 --- a/airtime_mvc/application/layouts/scripts/library.phtml +++ b/airtime_mvc/application/layouts/scripts/library.phtml @@ -5,6 +5,7 @@ headTitle() ?> headScript() ?> headLink() ?> + google_analytics)?$this->google_analytics:"" ?> diff --git a/airtime_mvc/application/layouts/scripts/login.phtml b/airtime_mvc/application/layouts/scripts/login.phtml index 88328f2c5..e91b735ee 100644 --- a/airtime_mvc/application/layouts/scripts/login.phtml +++ b/airtime_mvc/application/layouts/scripts/login.phtml @@ -5,6 +5,7 @@ headTitle() ?> headScript() ?> headLink() ?> + google_analytics)?$this->google_analytics:"" ?> diff --git a/airtime_mvc/application/layouts/scripts/search.phtml b/airtime_mvc/application/layouts/scripts/search.phtml index 8cedbe21b..c3195b101 100644 --- a/airtime_mvc/application/layouts/scripts/search.phtml +++ b/airtime_mvc/application/layouts/scripts/search.phtml @@ -5,6 +5,7 @@ headTitle() ?> headScript() ?> headLink() ?> + google_analytics)?$this->google_analytics:"" ?>
partial('partialviews/header.phtml', array("user" => $this->loggedInAs())) ?>
diff --git a/airtime_mvc/application/models/ShowInstance.php b/airtime_mvc/application/models/ShowInstance.php index b5dbfb55b..7a70f73e2 100644 --- a/airtime_mvc/application/models/ShowInstance.php +++ b/airtime_mvc/application/models/ShowInstance.php @@ -784,6 +784,7 @@ class Application_Model_ShowInstance { $sql = "SELECT si.id" ." FROM $CC_CONFIG[showInstances] si" ." WHERE si.ends < TIMESTAMP '$p_timeNow'" + ." AND si.modified_instance = 'f'" ." ORDER BY si.ends DESC" ." LIMIT 1"; @@ -798,10 +799,18 @@ class Application_Model_ShowInstance { public static function GetCurrentShowInstance($p_timeNow){ global $CC_CONFIG, $CC_DBC; + /* Orderby si.starts descending, because in some cases + * we can have multiple shows overlapping each other. In + * this case, the show that started later is the one that + * is actually playing, and so this is the one we want. + */ + $sql = "SELECT si.id" ." FROM $CC_CONFIG[showInstances] si" ." WHERE si.starts <= TIMESTAMP '$p_timeNow'" ." AND si.ends > TIMESTAMP '$p_timeNow'" + ." AND si.modified_instance = 'f'" + ." ORDER BY si.starts DESC" ." LIMIT 1"; $id = $CC_DBC->GetOne($sql); @@ -818,6 +827,7 @@ class Application_Model_ShowInstance { $sql = "SELECT si.id" ." FROM $CC_CONFIG[showInstances] si" ." WHERE si.starts > TIMESTAMP '$p_timeNow'" + ." AND si.modified_instance = 'f'" ." ORDER BY si.starts" ." LIMIT 1"; diff --git a/python_apps/media-monitor/airtimefilemonitor/airtimemetadata.py b/python_apps/media-monitor/airtimefilemonitor/airtimemetadata.py index 17c97259e..dd9b481af 100644 --- a/python_apps/media-monitor/airtimefilemonitor/airtimemetadata.py +++ b/python_apps/media-monitor/airtimefilemonitor/airtimemetadata.py @@ -161,22 +161,24 @@ class AirtimeMetadata: self.logger.error("Exception %s", e) return None + #check if file has any metadata if file_info is None: return None - #check if file has any metadata - if file_info is not None: - for key in file_info.keys() : - if key in self.mutagen2airtime and len(file_info[key]) > 0: - info = file_info[key][0] - while True: - temp = re.search(u"[\x80-\x9f]", info) - if temp is not None: - s = temp.group(0) - replace = self.cp1252toUnicode.get(s) - info = re.sub(s, replace, info) - else: - break - md[self.mutagen2airtime[key]] = info + + for key in file_info.keys() : + if key in self.mutagen2airtime and len(file_info[key]) > 0: + info = file_info[key][0] + while True: + temp = re.search(u"[\x80-\x9f]", info) + if temp is not None: + s = temp.group(0) + replace = self.cp1252toUnicode.get(s) + info = re.sub(s, replace, info) + else: + break + md[self.mutagen2airtime[key]] = info + + if 'MDATA_KEY_TITLE' not in md: #get rid of file extention from original name, name might have more than 1 '.' in it. #filepath = to_unicode(filepath) diff --git a/utils/phone_home_stat.php b/utils/phone_home_stat.php index c7738a6b4..fa6848bea 100644 --- a/utils/phone_home_stat.php +++ b/utils/phone_home_stat.php @@ -48,9 +48,7 @@ if (PEAR::isError($CC_DBC)) { echo "Database connection problem.".PHP_EOL; echo "Check if database '{$CC_CONFIG['dsn']['database']}' exists". " with corresponding permissions.".PHP_EOL;*/ - if ($p_exitOnError) { - exit(1); - } + exit(1); } else { //echo "* Connected to database".PHP_EOL; $CC_DBC->setFetchMode(DB_FETCHMODE_ASSOC);