Esempio n. 1
0
     break;
 case 'random':
     $matchlist = array();
     if ($_REQUEST['genre'][0] != '-1') {
         $matchlist['genre'] = $_REQUEST['genre'];
     }
     if ($_REQUEST['catalog'] != '-1') {
         $matchlist['catalog'] = $_REQUEST['catalog'];
     }
     /* Setup the options array */
     $options = array('limit' => $_REQUEST['random'], 'random_type' => $_REQUEST['random_type'], 'size_limit' => $_REQUEST['size_limit']);
     $media_ids = get_random_songs($options, $matchlist);
     break;
 case 'democratic':
     $democratic = new Democratic($_REQUEST['democratic_id']);
     $urls = array($democratic->play_url());
     break;
 case 'download':
     $media_ids[] = array('object_type' => 'song', 'object_id' => scrub_in($_REQUEST['song_id']));
     break;
 case 'live_stream':
     $object = new Radio($_REQUEST['stream_id']);
     if ($object->name) {
         $media_ids[] = array('object_type' => 'radio', 'object_id' => scrub_in($_REQUEST['stream_id']));
     }
     break;
 case 'album_preview':
     $songs = Song_preview::get_song_previews($_REQUEST['mbid']);
     foreach ($songs as $song) {
         if (!empty($song->file)) {
             $media_ids[] = array('object_type' => 'song_preview', 'object_id' => $song->id);