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,
|
'Africa' => DateTimeZone::AFRICA,
|
||||||
'America' => DateTimeZone::AMERICA,
|
'America' => DateTimeZone::AMERICA,
|
||||||
'Antarctica' => DateTimeZone::ANTARCTICA,
|
'Antarctica' => DateTimeZone::ANTARCTICA,
|
||||||
|
'Arctic' => DateTimeZone::ARCTIC,
|
||||||
'Asia' => DateTimeZone::ASIA,
|
'Asia' => DateTimeZone::ASIA,
|
||||||
'Atlantic' => DateTimeZone::ATLANTIC,
|
'Atlantic' => DateTimeZone::ATLANTIC,
|
||||||
|
'Australia' => DateTimeZone::AUSTRALIA,
|
||||||
'Europe' => DateTimeZone::EUROPE,
|
'Europe' => DateTimeZone::EUROPE,
|
||||||
'Indian' => DateTimeZone::INDIAN,
|
'Indian' => DateTimeZone::INDIAN,
|
||||||
'Pacific' => DateTimeZone::PACIFIC
|
'Pacific' => DateTimeZone::PACIFIC
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
<title>Live stream</title>
|
<title>Live stream</title>
|
||||||
<?php echo $this->headScript() ?>
|
<?php echo $this->headScript() ?>
|
||||||
<?php echo $this->headLink() ?>
|
<?php echo $this->headLink() ?>
|
||||||
|
<?php echo isset($this->google_analytics)?$this->google_analytics:"" ?>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="content"><?php echo $this->layout()->content ?></div>
|
<div id="content"><?php echo $this->layout()->content ?></div>
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
<?php echo $this->headTitle() ?>
|
<?php echo $this->headTitle() ?>
|
||||||
<?php echo $this->headScript() ?>
|
<?php echo $this->headScript() ?>
|
||||||
<?php echo $this->headLink() ?>
|
<?php echo $this->headLink() ?>
|
||||||
|
<?php echo isset($this->google_analytics)?$this->google_analytics:"" ?>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
<?php echo $this->headTitle() ?>
|
<?php echo $this->headTitle() ?>
|
||||||
<?php echo $this->headScript() ?>
|
<?php echo $this->headScript() ?>
|
||||||
<?php echo $this->headLink() ?>
|
<?php echo $this->headLink() ?>
|
||||||
|
<?php echo isset($this->google_analytics)?$this->google_analytics:"" ?>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
<?php echo $this->headTitle() ?>
|
<?php echo $this->headTitle() ?>
|
||||||
<?php echo $this->headScript() ?>
|
<?php echo $this->headScript() ?>
|
||||||
<?php echo $this->headLink() ?>
|
<?php echo $this->headLink() ?>
|
||||||
|
<?php echo isset($this->google_analytics)?$this->google_analytics:"" ?>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
<?php echo $this->headTitle() ?>
|
<?php echo $this->headTitle() ?>
|
||||||
<?php echo $this->headScript() ?>
|
<?php echo $this->headScript() ?>
|
||||||
<?php echo $this->headLink() ?>
|
<?php echo $this->headLink() ?>
|
||||||
|
<?php echo isset($this->google_analytics)?$this->google_analytics:"" ?>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="nowplayingbar"><?php echo $this->partial('partialviews/header.phtml', array("user" => $this->loggedInAs())) ?></div>
|
<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"
|
$sql = "SELECT si.id"
|
||||||
." FROM $CC_CONFIG[showInstances] si"
|
." FROM $CC_CONFIG[showInstances] si"
|
||||||
." WHERE si.ends < TIMESTAMP '$p_timeNow'"
|
." WHERE si.ends < TIMESTAMP '$p_timeNow'"
|
||||||
|
." AND si.modified_instance = 'f'"
|
||||||
." ORDER BY si.ends DESC"
|
." ORDER BY si.ends DESC"
|
||||||
." LIMIT 1";
|
." LIMIT 1";
|
||||||
|
|
||||||
|
@ -798,10 +799,18 @@ class Application_Model_ShowInstance {
|
||||||
public static function GetCurrentShowInstance($p_timeNow){
|
public static function GetCurrentShowInstance($p_timeNow){
|
||||||
global $CC_CONFIG, $CC_DBC;
|
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"
|
$sql = "SELECT si.id"
|
||||||
." FROM $CC_CONFIG[showInstances] si"
|
." FROM $CC_CONFIG[showInstances] si"
|
||||||
." WHERE si.starts <= TIMESTAMP '$p_timeNow'"
|
." WHERE si.starts <= TIMESTAMP '$p_timeNow'"
|
||||||
." AND si.ends > TIMESTAMP '$p_timeNow'"
|
." AND si.ends > TIMESTAMP '$p_timeNow'"
|
||||||
|
." AND si.modified_instance = 'f'"
|
||||||
|
." ORDER BY si.starts DESC"
|
||||||
." LIMIT 1";
|
." LIMIT 1";
|
||||||
|
|
||||||
$id = $CC_DBC->GetOne($sql);
|
$id = $CC_DBC->GetOne($sql);
|
||||||
|
@ -818,6 +827,7 @@ class Application_Model_ShowInstance {
|
||||||
$sql = "SELECT si.id"
|
$sql = "SELECT si.id"
|
||||||
." FROM $CC_CONFIG[showInstances] si"
|
." FROM $CC_CONFIG[showInstances] si"
|
||||||
." WHERE si.starts > TIMESTAMP '$p_timeNow'"
|
." WHERE si.starts > TIMESTAMP '$p_timeNow'"
|
||||||
|
." AND si.modified_instance = 'f'"
|
||||||
." ORDER BY si.starts"
|
." ORDER BY si.starts"
|
||||||
." LIMIT 1";
|
." LIMIT 1";
|
||||||
|
|
||||||
|
|
|
@ -161,22 +161,24 @@ class AirtimeMetadata:
|
||||||
self.logger.error("Exception %s", e)
|
self.logger.error("Exception %s", e)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
#check if file has any metadata
|
||||||
if file_info is None:
|
if file_info is None:
|
||||||
return None
|
return None
|
||||||
#check if file has any metadata
|
|
||||||
if file_info is not None:
|
for key in file_info.keys() :
|
||||||
for key in file_info.keys() :
|
if key in self.mutagen2airtime and len(file_info[key]) > 0:
|
||||||
if key in self.mutagen2airtime and len(file_info[key]) > 0:
|
info = file_info[key][0]
|
||||||
info = file_info[key][0]
|
while True:
|
||||||
while True:
|
temp = re.search(u"[\x80-\x9f]", info)
|
||||||
temp = re.search(u"[\x80-\x9f]", info)
|
if temp is not None:
|
||||||
if temp is not None:
|
s = temp.group(0)
|
||||||
s = temp.group(0)
|
replace = self.cp1252toUnicode.get(s)
|
||||||
replace = self.cp1252toUnicode.get(s)
|
info = re.sub(s, replace, info)
|
||||||
info = re.sub(s, replace, info)
|
else:
|
||||||
else:
|
break
|
||||||
break
|
md[self.mutagen2airtime[key]] = info
|
||||||
md[self.mutagen2airtime[key]] = info
|
|
||||||
|
|
||||||
if 'MDATA_KEY_TITLE' not in md:
|
if 'MDATA_KEY_TITLE' not in md:
|
||||||
#get rid of file extention from original name, name might have more than 1 '.' in it.
|
#get rid of file extention from original name, name might have more than 1 '.' in it.
|
||||||
#filepath = to_unicode(filepath)
|
#filepath = to_unicode(filepath)
|
||||||
|
|
|
@ -48,9 +48,7 @@ if (PEAR::isError($CC_DBC)) {
|
||||||
echo "Database connection problem.".PHP_EOL;
|
echo "Database connection problem.".PHP_EOL;
|
||||||
echo "Check if database '{$CC_CONFIG['dsn']['database']}' exists".
|
echo "Check if database '{$CC_CONFIG['dsn']['database']}' exists".
|
||||||
" with corresponding permissions.".PHP_EOL;*/
|
" with corresponding permissions.".PHP_EOL;*/
|
||||||
if ($p_exitOnError) {
|
exit(1);
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
//echo "* Connected to database".PHP_EOL;
|
//echo "* Connected to database".PHP_EOL;
|
||||||
$CC_DBC->setFetchMode(DB_FETCHMODE_ASSOC);
|
$CC_DBC->setFetchMode(DB_FETCHMODE_ASSOC);
|
||||||
|
|
Loading…
Reference in New Issue