Merge branch '2.2.x' of dev.sourcefabric.org:airtime into 2.2.x

This commit is contained in:
denise 2012-11-02 10:48:16 -04:00
commit a937df30ad
13 changed files with 39 additions and 18 deletions

View File

@ -292,7 +292,8 @@ SQL;
ft.artist_name AS file_artist_name,
ft.album_title AS file_album_title,
ft.length AS file_length,
ft.file_exists AS file_exists
ft.file_exists AS file_exists,
ft.mime AS file_mime
SQL;
$filesJoin = <<<SQL
cc_schedule AS sched
@ -319,7 +320,8 @@ SQL;
sub.login AS file_artist_name,
ws.description AS file_album_title,
ws.length AS file_length,
't'::BOOL AS file_exists
't'::BOOL AS file_exists,
NULL as file_mime
SQL;
$streamJoin = <<<SQL
cc_schedule AS sched

View File

@ -41,6 +41,7 @@ class Application_Model_ShowBuilder
"fadein" => "",
"fadeout" => "",
"image" => false,
"mime" => null,
"color" => "", //in hex without the '#' sign.
"backgroundColor" => "", //in hex without the '#' sign.
);
@ -277,6 +278,7 @@ class Application_Model_ShowBuilder
$row["cueout"] = $p_item["cue_out"];
$row["fadein"] = round(substr($p_item["fade_in"], 6), 6);
$row["fadeout"] = round(substr($p_item["fade_out"], 6), 6);
$row["mime"] = $p_item["file_mime"];
$row["pos"] = $this->pos++;
@ -471,7 +473,7 @@ class Application_Model_ShowBuilder
$display_items[] = $this->makeFooterRow($scheduled_items[
count($scheduled_items)-1]);
}
return array(
"schedule" => $display_items,
"showInstances" => $this->showInstances);

View File

@ -54,7 +54,7 @@ class CcBlockTableMap extends TableMap {
*/
public function buildRelations()
{
$this->addRelation('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('creator_id' => 'id', ), null, null);
$this->addRelation('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('creator_id' => 'id', ), 'CASCADE', null);
$this->addRelation('CcPlaylistcontents', 'CcPlaylistcontents', RelationMap::ONE_TO_MANY, array('id' => 'block_id', ), 'CASCADE', null);
$this->addRelation('CcBlockcontents', 'CcBlockcontents', RelationMap::ONE_TO_MANY, array('id' => 'block_id', ), 'CASCADE', null);
$this->addRelation('CcBlockcriteria', 'CcBlockcriteria', RelationMap::ONE_TO_MANY, array('id' => 'block_id', ), 'CASCADE', null);

View File

@ -64,7 +64,7 @@ class CcSubjsTableMap extends TableMap {
$this->addRelation('CcPerms', 'CcPerms', RelationMap::ONE_TO_MANY, array('id' => 'subj', ), 'CASCADE', null);
$this->addRelation('CcShowHosts', 'CcShowHosts', RelationMap::ONE_TO_MANY, array('id' => 'subjs_id', ), 'CASCADE', null);
$this->addRelation('CcPlaylist', 'CcPlaylist', RelationMap::ONE_TO_MANY, array('id' => 'creator_id', ), 'CASCADE', null);
$this->addRelation('CcBlock', 'CcBlock', RelationMap::ONE_TO_MANY, array('id' => 'creator_id', ), null, null);
$this->addRelation('CcBlock', 'CcBlock', RelationMap::ONE_TO_MANY, array('id' => 'creator_id', ), 'CASCADE', null);
$this->addRelation('CcPref', 'CcPref', RelationMap::ONE_TO_MANY, array('id' => 'subjid', ), 'CASCADE', null);
$this->addRelation('CcSess', 'CcSess', RelationMap::ONE_TO_MANY, array('id' => 'userid', ), 'CASCADE', null);
$this->addRelation('CcSubjsToken', 'CcSubjsToken', RelationMap::ONE_TO_MANY, array('id' => 'user_id', ), 'CASCADE', null);

View File

@ -407,6 +407,9 @@ abstract class BaseCcSubjsPeer {
// Invalidate objects in CcPlaylistPeer instance pool,
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
CcPlaylistPeer::clearInstancePool();
// Invalidate objects in CcBlockPeer instance pool,
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
CcBlockPeer::clearInstancePool();
// Invalidate objects in CcPrefPeer instance pool,
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
CcPrefPeer::clearInstancePool();

View File

@ -250,7 +250,7 @@
<parameter name="foreign_table" value="cc_blockcontents" />
<parameter name="expression" value="SUM(cliplength)" />
</behavior>
<foreign-key foreignTable="cc_subjs" name="cc_block_createdby_fkey">
<foreign-key foreignTable="cc_subjs" name="cc_block_createdby_fkey" onDelete="CASCADE">
<reference local="creator_id" foreign="id"/>
</foreign-key>
</table>

View File

@ -697,7 +697,7 @@ ALTER TABLE "cc_playlistcontents" ADD CONSTRAINT "cc_playlistcontents_block_id_f
ALTER TABLE "cc_playlistcontents" ADD CONSTRAINT "cc_playlistcontents_playlist_id_fkey" FOREIGN KEY ("playlist_id") REFERENCES "cc_playlist" ("id") ON DELETE CASCADE;
ALTER TABLE "cc_block" ADD CONSTRAINT "cc_block_createdby_fkey" FOREIGN KEY ("creator_id") REFERENCES "cc_subjs" ("id");
ALTER TABLE "cc_block" ADD CONSTRAINT "cc_block_createdby_fkey" FOREIGN KEY ("creator_id") REFERENCES "cc_subjs" ("id") ON DELETE CASCADE;
ALTER TABLE "cc_blockcontents" ADD CONSTRAINT "cc_blockcontents_file_id_fkey" FOREIGN KEY ("file_id") REFERENCES "cc_files" ("id") ON DELETE CASCADE;

View File

@ -14,5 +14,6 @@ function isAudioSupported(mime){
//Note that checking the navigator.mimeTypes value does not work for IE7, but the alternative
//is adding a javascript library to do the work for you, which seems like overkill....
return (!!audio.canPlayType && audio.canPlayType(bMime) != "") ||
(mime.indexOf("mp3") != -1 && navigator.mimeTypes ["application/x-shockwave-flash"] != undefined);
(mime.indexOf("mp3") != -1 && navigator.mimeTypes ["application/x-shockwave-flash"] != undefined) ||
(mime.indexOf("mp4") != -1 && navigator.mimeTypes ["application/x-shockwave-flash"] != undefined);
}

View File

@ -37,6 +37,11 @@ var AIRTIME = (function(AIRTIME) {
var $nRow = $(nRow);
if (aData.ftype === "audioclip") {
$nRow.addClass("lib-audio");
$image = $nRow.find('td.library_type');
if (!isAudioSupported(aData.mime)) {
$image.html('<span class="ui-icon ui-icon-locked"></span>');
aData.image = '<span class="ui-icon ui-icon-locked"></span>';
}
} else if (aData.ftype === "stream") {
$nRow.addClass("lib-stream");
} else if (aData.ftype === "block") {

View File

@ -29,6 +29,11 @@ var AIRTIME = (function(AIRTIME) {
if (aData.ftype === "audioclip") {
$nRow.addClass("lib-audio");
$image = $nRow.find('td.library_type');
if (!isAudioSupported(aData.mime)) {
$image.html('<span class="ui-icon ui-icon-locked"></span>');
aData.image = '<span class="ui-icon ui-icon-locked"></span>';
}
} else if (aData.ftype === "stream") {
$nRow.addClass("lib-stream");
} else {

View File

@ -542,7 +542,7 @@ var AIRTIME = (function(AIRTIME) {
type = $("#library_display_type").find("select").val();
type = (type === undefined) ? 0 : type;
aoData.push( { name: "type", value: type} );
$.ajax( {
"dataType": 'json',
"type": "POST",
@ -562,7 +562,9 @@ var AIRTIME = (function(AIRTIME) {
// pl_
open_playlist_preview(playlistIndex, 0);
} else if (aData.ftype === 'audioclip') {
open_audio_preview(aData.ftype, aData.audioFile, aData.track_title, aData.artist_name);
if (isAudioSupported(aData.mime)) {
open_audio_preview(aData.ftype, aData.audioFile, aData.track_title, aData.artist_name);
}
} else if (aData.ftype == 'stream') {
open_audio_preview(aData.ftype, aData.audioFile, aData.track_title, aData.artist_name);
} else if (aData.ftype == 'block' && aData.bl_type == 'static') {

View File

@ -369,7 +369,8 @@ var AIRTIME = (function(AIRTIME){
/* cue in */ {"mDataProp": "cuein", "sTitle": "Cue In", "bVisible": false, "sClass": "sb-cue-in"},
/* cue out */ {"mDataProp": "cueout", "sTitle": "Cue Out", "bVisible": false, "sClass": "sb-cue-out"},
/* fade in */ {"mDataProp": "fadein", "sTitle": "Fade In", "bVisible": false, "sClass": "sb-fade-in"},
/* fade out */ {"mDataProp": "fadeout", "sTitle": "Fade Out", "bVisible": false, "sClass": "sb-fade-out"}
/* fade out */ {"mDataProp": "fadeout", "sTitle": "Fade Out", "bVisible": false, "sClass": "sb-fade-out"},
/* Mime */ {"mDataProp" : "mime", "sTitle" : "Mime", "bVisible": false, "sClass": "sb-mime"}
],
"bJQueryUI": true,
@ -549,11 +550,16 @@ var AIRTIME = (function(AIRTIME){
$image = $nRow.find('td.sb-image');
//check if the file exists.
if (aData.image === true) {
$image.html('<img title="Track preview" src="/css/images/icon_audioclip.png"></img>')
$nRow.addClass("lib-audio");
if (!isAudioSupported(aData.mime)) {
$image.html('<span class="ui-icon ui-icon-locked"></span>');
} else {
$image.html('<img title="Track preview" src="/css/images/icon_audioclip.png"></img>')
.click(function() {
open_show_preview(aData.instance, aData.pos);
return false;
});
}
}
else {
$image.html('<span class="ui-icon ui-icon-alert"></span>');

View File

@ -201,9 +201,6 @@ def append_dj_inputs(master_harbor_input_port, master_harbor_input_mount_point,
dj_live = mksafe(audio_to_stereo(input.harbor(id="live_dj_harbor", dj_harbor_input_mount_point, port=dj_harbor_input_port, auth=check_dj_client,
max=40., on_connect=live_dj_connect, on_disconnect=live_dj_disconnect)))
master_dj = rewrite_metadata([("artist","Airtime"), ("title", "Master Dj")],master_dj)
dj_live = rewrite_metadata([("artist","Airtime"), ("title", "Live Dj")],dj_live)
ignore(output.dummy(master_dj, fallible=true))
ignore(output.dummy(dj_live, fallible=true))
switch(id="master_dj_switch", track_sensitive=false, transitions=[transition, transition, transition], [({!master_dj_enabled},master_dj), ({!live_dj_enabled},dj_live), ({true}, s)])
@ -211,14 +208,12 @@ def append_dj_inputs(master_harbor_input_port, master_harbor_input_mount_point,
master_dj = mksafe(audio_to_stereo(input.harbor(id="master_harbor", master_harbor_input_mount_point, port=master_harbor_input_port, auth=check_master_dj_client,
max=40., on_connect=master_dj_connect, on_disconnect=master_dj_disconnect)))
ignore(output.dummy(master_dj, fallible=true))
master_dj = rewrite_metadata([("artist","Airtime"), ("title", "Master Dj")],master_dj)
switch(id="master_dj_switch", track_sensitive=false, transitions=[transition, transition], [({!master_dj_enabled},master_dj), ({true}, s)])
elsif dj_harbor_input_port != 0 and dj_harbor_input_mount_point != "" then
dj_live = mksafe(audio_to_stereo(input.harbor(id="live_dj_harbor", dj_harbor_input_mount_point, port=dj_harbor_input_port, auth=check_dj_client,
max=40., on_connect=live_dj_connect, on_disconnect=live_dj_disconnect)))
dj_live = rewrite_metadata([("artist","Airtime"), ("title", "Live Dj")],dj_live)
ignore(output.dummy(dj_live, fallible=true))
switch(id="live_dj_switch", track_sensitive=false, transitions=[transition, transition], [({!live_dj_enabled},dj_live), ({true}, s)])
else