Merge branch '2.0.x' of dev.sourcefabric.org:airtime into 2.0.x
This commit is contained in:
commit
4043f011b5
|
@ -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
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
<title>Live stream</title>
|
||||
<?php echo $this->headScript() ?>
|
||||
<?php echo $this->headLink() ?>
|
||||
<?php echo isset($this->google_analytics)?$this->google_analytics:"" ?>
|
||||
</head>
|
||||
<body>
|
||||
<div id="content"><?php echo $this->layout()->content ?></div>
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
<?php echo $this->headTitle() ?>
|
||||
<?php echo $this->headScript() ?>
|
||||
<?php echo $this->headLink() ?>
|
||||
<?php echo isset($this->google_analytics)?$this->google_analytics:"" ?>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
<?php echo $this->headTitle() ?>
|
||||
<?php echo $this->headScript() ?>
|
||||
<?php echo $this->headLink() ?>
|
||||
<?php echo isset($this->google_analytics)?$this->google_analytics:"" ?>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
<?php echo $this->headTitle() ?>
|
||||
<?php echo $this->headScript() ?>
|
||||
<?php echo $this->headLink() ?>
|
||||
<?php echo isset($this->google_analytics)?$this->google_analytics:"" ?>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
<?php echo $this->headTitle() ?>
|
||||
<?php echo $this->headScript() ?>
|
||||
<?php echo $this->headLink() ?>
|
||||
<?php echo isset($this->google_analytics)?$this->google_analytics:"" ?>
|
||||
</head>
|
||||
<body>
|
||||
<div id="nowplayingbar"><?php echo $this->partial('partialviews/header.phtml', array("user" => $this->loggedInAs())) ?></div>
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue