Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
This commit is contained in:
commit
63bd2f6381
|
@ -356,9 +356,9 @@ SQL;
|
|||
." SET media_item_played=TRUE";
|
||||
// we need to update 'broadcasted' column as well
|
||||
// check the current switch status
|
||||
$live_dj = Application_Model_Preference::GetSourceSwitchStatus('live_dj') == 'on'?true:false;
|
||||
$master_dj = Application_Model_Preference::GetSourceSwitchStatus('master_dj') == 'on'?true:false;
|
||||
$scheduled_play = Application_Model_Preference::GetSourceSwitchStatus('scheduled_play') == 'on'?true:false;
|
||||
$live_dj = Application_Model_Preference::GetSourceSwitchStatus('live_dj') == 'on';
|
||||
$master_dj = Application_Model_Preference::GetSourceSwitchStatus('master_dj') == 'on';
|
||||
$scheduled_play = Application_Model_Preference::GetSourceSwitchStatus('scheduled_play') == 'on';
|
||||
|
||||
if (!$live_dj && !$master_dj && $scheduled_play) {
|
||||
$sql .= ", broadcasted=1";
|
||||
|
|
|
@ -475,10 +475,9 @@ class Application_Model_Show
|
|||
->filterByDbShowId($this->_showId)
|
||||
->findOne();
|
||||
|
||||
if (!is_null($showDaysRow)) {
|
||||
if (!is_null($showDaysRow))
|
||||
return $showDaysRow->getDbRepeatType();
|
||||
} else
|
||||
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -607,24 +606,30 @@ class Application_Model_Show
|
|||
* Get the start date of the current show in UTC timezone.
|
||||
*
|
||||
* @return string
|
||||
* The start date in the format YYYY-MM-DD
|
||||
* The start date in the format YYYY-MM-DD or empty string in case
|
||||
* start date could not be found
|
||||
*/
|
||||
public function getStartDateAndTime()
|
||||
{
|
||||
$con = Propel::getConnection();
|
||||
|
||||
$showId = $this->getId();
|
||||
$sql = "SELECT first_show, start_time, timezone FROM cc_show_days"
|
||||
." WHERE show_id = $showId"
|
||||
$stmt = $con->prepare(
|
||||
"SELECT first_show, start_time, timezone FROM cc_show_days"
|
||||
." WHERE show_id = :showId"
|
||||
." ORDER BY first_show"
|
||||
." LIMIT 1";
|
||||
." LIMIT 1");
|
||||
|
||||
$query = $con->query($sql);
|
||||
$stmt->bindParam(':showId', $showId);
|
||||
$stmt->execute();
|
||||
|
||||
if ($query->rowCount() == 0) {
|
||||
//$query = $con->query($sql);
|
||||
|
||||
if (!$stmt) {
|
||||
return "";
|
||||
} else {
|
||||
$rows = $query->fetchAll();
|
||||
}
|
||||
|
||||
$rows = $stmt->fetchAll();
|
||||
$row = $rows[0];
|
||||
|
||||
$dt = new DateTime($row["first_show"]." ".$row["start_time"], new DateTimeZone($row["timezone"]));
|
||||
|
@ -632,7 +637,6 @@ class Application_Model_Show
|
|||
|
||||
return $dt->format("Y-m-d H:i");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the start date of the current show in UTC timezone.
|
||||
|
@ -1064,8 +1068,8 @@ class Application_Model_Show
|
|||
$ccShow->setDbGenre($data['add_show_genre']);
|
||||
$ccShow->setDbColor($data['add_show_color']);
|
||||
$ccShow->setDbBackgroundColor($data['add_show_background_color']);
|
||||
$ccShow->setDbLiveStreamUsingAirtimeAuth($data['cb_airtime_auth'] == 1?true:false);
|
||||
$ccShow->setDbLiveStreamUsingCustomAuth($data['cb_custom_auth'] == 1?true:false);
|
||||
$ccShow->setDbLiveStreamUsingAirtimeAuth($data['cb_airtime_auth'] == 1);
|
||||
$ccShow->setDbLiveStreamUsingCustomAuth($data['cb_custom_auth'] == 1);
|
||||
$ccShow->setDbLiveStreamUser($data['custom_username']);
|
||||
$ccShow->setDbLiveStreamPass($data['custom_password']);
|
||||
$ccShow->save();
|
||||
|
@ -1250,6 +1254,8 @@ class Application_Model_Show
|
|||
*/
|
||||
private static function populateShow($p_showDaysRow, $p_populateUntilDateTime)
|
||||
{
|
||||
// TODO : use constants instead of int values here? or maybe php will
|
||||
// get enum types by the time somebody gets around to fix this. -- RG
|
||||
if ($p_showDaysRow["repeat_type"] == -1) {
|
||||
Application_Model_Show::populateNonRepeatingShow($p_showDaysRow, $p_populateUntilDateTime);
|
||||
} elseif ($p_showDaysRow["repeat_type"] == 0) {
|
||||
|
@ -1740,7 +1746,8 @@ class Application_Model_Show
|
|||
$event["showId"] = intval($show["show_id"]);
|
||||
$event["record"] = intval($show["record"]);
|
||||
$event["rebroadcast"] = intval($show["rebroadcast"]);
|
||||
$event["soundcloud_id"] = is_null($show["soundcloud_id"]) ? -1 : $show["soundcloud_id"];
|
||||
$event["soundcloud_id"] = is_null($show["soundcloud_id"])
|
||||
? -1 : $show["soundcloud_id"];
|
||||
|
||||
//event colouring
|
||||
if ($show["color"] != "") {
|
||||
|
|
|
@ -175,15 +175,13 @@ class Application_Model_StreamSetting
|
|||
*/
|
||||
public static function setStreamSetting($data)
|
||||
{
|
||||
$con = Propel::getConnection();
|
||||
|
||||
foreach ($data as $key => $d) {
|
||||
if ($key == "output_sound_device" || $key == "icecast_vorbis_metadata") {
|
||||
$v = $d == 1?"true":"false";
|
||||
$v = ($d == 1) ? "true" : "false";
|
||||
|
||||
self::saveStreamSetting($key, $v);
|
||||
} elseif ($key == "output_sound_device_type") {
|
||||
self::saveStreamSetting($key, $v);
|
||||
self::saveStreamSetting($key, $d);
|
||||
} elseif (is_array($d)) {
|
||||
$temp = explode('_', $key);
|
||||
$prefix = $temp[0];
|
||||
|
|
|
@ -168,6 +168,9 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
|
|||
if ($result == 0) {
|
||||
$valid['url'][0] = false;
|
||||
$valid['url'][1] = 'URL should be of form "http://domain"';
|
||||
} elseif (strlen($url) > 512) {
|
||||
$valid['url'][0] = false;
|
||||
$valid['url'][1] = 'URL should be 512 characters or less';
|
||||
} else {
|
||||
|
||||
try {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<p>Here's how you can get started using Airtime to automate your broadcasts: </p>
|
||||
|
||||
<ol>
|
||||
<li>Add your files to the library using the "Add Media" button. You can drag and drop your files to this window too.</li>
|
||||
<li>Begin by adding your files to the library using the "Add Media" menu button. You can drag and drop your files to this window too.</li>
|
||||
<li>Create a show by going to "Calendar" in the menu bar, and then clicking the "+ Show" icon. This can be either a one-time or repeating show. Only admins and program managers can add shows.</li>
|
||||
<li>Add media to the show by going to your show in the Schedule calendar, left-clicking on it and selecting "Add / Remove Content".</li>
|
||||
<li>Select your media from the left pane and drag them to your show in the right pane.</li>
|
||||
|
|
|
@ -420,7 +420,7 @@
|
|||
<column name="name" phpName="DbName" type="VARCHAR" size="255" required="true" />
|
||||
<!-- TODO, remove hardlimit on this column length? -->
|
||||
<column name="description" phpName="DbDescription" type="VARCHAR" size="255" required="true" />
|
||||
<column name="url" phpName="DbUrl" type="VARCHAR" size="255" required="true" />
|
||||
<column name="url" phpName="DbUrl" type="VARCHAR" size="512" required="true" />
|
||||
<column name="length" phpName="DbLength" type="VARCHAR" sqlType="interval" required="true" defaultValue="00:00:00"/>
|
||||
<column name="creator_id" phpName="DbCreatorId" type="INTEGER" required="true" />
|
||||
<column name="mtime" phpName="DbMtime" type="TIMESTAMP" size="6" required="true" />
|
||||
|
|
|
@ -95,7 +95,7 @@ CREATE TABLE cc_webstream (
|
|||
id integer DEFAULT nextval('cc_webstream_id_seq'::regclass) NOT NULL,
|
||||
name character varying(255) NOT NULL,
|
||||
description character varying(255) NOT NULL,
|
||||
url character varying(255) NOT NULL,
|
||||
url character varying(512) NOT NULL,
|
||||
length interval DEFAULT '00:00:00'::interval NOT NULL,
|
||||
creator_id integer NOT NULL,
|
||||
mtime timestamp(6) without time zone NOT NULL,
|
||||
|
|
Loading…
Reference in New Issue