Massive refactor of the analyzer branch and sync it back up with the
cloud storage branch (for the last time) * Backported all the bugfixes from cc-5709-airtime-analyzer-cloud-storage * Backported missing FileStorageBackend.php * Fixed CC-6001: Track titles and artist names with slashes break audio preview * Refactored all the MediaController code, pulling out the logic into MediaService * Fixed an API key leak to guests in the Media API * Made this branch work without cloud_storage.conf (defaults to file storage) * Made ApiController's getMediaAction use the MediaService code
This commit is contained in:
parent
6d00da89db
commit
2a89e4d5a0
13 changed files with 275 additions and 179 deletions
|
@ -91,16 +91,11 @@ function openAudioPreview(p_event) {
|
|||
}
|
||||
}
|
||||
|
||||
function open_audio_preview(type, id, audioFileTitle, audioFileArtist) {
|
||||
// we need to remove soundcloud icon from audioFileTitle
|
||||
var index = audioFileTitle.indexOf("<span class=");
|
||||
if(index != -1){
|
||||
audioFileTitle = audioFileTitle.substring(0,index);
|
||||
}
|
||||
function open_audio_preview(type, id) {
|
||||
// The reason that we need to encode artist and title string is that
|
||||
// sometime they contain '/' or '\' and apache reject %2f or %5f
|
||||
// so the work around is to encode it twice.
|
||||
openPreviewWindow(baseUrl+'audiopreview/audio-preview/audioFileID/'+id+'/audioFileArtist/'+encodeURIComponent(encodeURIComponent(audioFileArtist))+'/audioFileTitle/'+encodeURIComponent(encodeURIComponent(audioFileTitle))+'/type/'+type);
|
||||
openPreviewWindow(baseUrl+'audiopreview/audio-preview/audioFileID/'+id+'/type/'+type);
|
||||
_preview_window.focus();
|
||||
}
|
||||
|
||||
|
|
|
@ -643,11 +643,11 @@ var AIRTIME = (function(AIRTIME) {
|
|||
open_playlist_preview(aData.audioFile, 0);
|
||||
} else if (aData.ftype === 'audioclip') {
|
||||
if (isAudioSupported(aData.mime)) {
|
||||
open_audio_preview(aData.ftype, aData.audioFile, aData.track_title, aData.artist_name);
|
||||
open_audio_preview(aData.ftype, aData.id);
|
||||
}
|
||||
} else if (aData.ftype == 'stream') {
|
||||
if (isAudioSupported(aData.mime)) {
|
||||
open_audio_preview(aData.ftype, aData.audioFile, aData.track_title, aData.artist_name);
|
||||
open_audio_preview(aData.ftype, aData.id);
|
||||
}
|
||||
} else if (aData.ftype == 'block' && aData.bl_type == 'static') {
|
||||
open_block_preview(aData.audioFile, 0);
|
||||
|
@ -955,7 +955,7 @@ var AIRTIME = (function(AIRTIME) {
|
|||
// pl_
|
||||
open_playlist_preview(playlistIndex, 0);
|
||||
} else if (data.ftype === 'audioclip' || data.ftype === 'stream') {
|
||||
open_audio_preview(data.ftype, data.audioFile, data.track_title, data.artist_name);
|
||||
open_audio_preview(data.ftype, data.id);
|
||||
} else if (data.ftype === 'block') {
|
||||
blockIndex = $(this).parent().attr('id').substring(3); // remove
|
||||
// the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue