summaryrefslogtreecommitdiffstats
path: root/stream.php
diff options
context:
space:
mode:
Diffstat (limited to 'stream.php')
-rw-r--r--stream.php84
1 files changed, 42 insertions, 42 deletions
diff --git a/stream.php b/stream.php
index 911e6b12..7e0ab8b3 100644
--- a/stream.php
+++ b/stream.php
@@ -31,17 +31,17 @@ $media_ids = array();
$web_path = Config::get('web_path');
/**
- * action switch
+ * action switch
*/
-switch ($_REQUEST['action']) {
- case 'basket':
- // Pull in our items (multiple types)
- $media_ids = $GLOBALS['user']->playlist->get_items();
+switch ($_REQUEST['action']) {
+ case 'basket':
+ // Pull in our items (multiple types)
+ $media_ids = $GLOBALS['user']->playlist->get_items();
// Check to see if 'clear' was passed if it was then we need to reset the basket
- if ( ($_REQUEST['playlist_method'] == 'clear' || Config::get('playlist_method') == 'clear') AND Config::get('play_type') != 'xspf_player') {
- $GLOBALS['user']->playlist->clear();
- }
+ if ( ($_REQUEST['playlist_method'] == 'clear' || Config::get('playlist_method') == 'clear') AND Config::get('play_type') != 'xspf_player') {
+ $GLOBALS['user']->playlist->clear();
+ }
break;
/* This is run if we need to gather info based on a tmp playlist */
@@ -50,25 +50,25 @@ switch ($_REQUEST['action']) {
$media_ids = $tmp_playlist->get_items();
break;
case 'play_favorite':
- $data = $GLOBALS['user']->get_favorites($_REQUEST['type']);
- $media_ids = array();
- switch ($_REQUEST['type']) {
+ $data = $GLOBALS['user']->get_favorites($_REQUEST['type']);
+ $media_ids = array();
+ switch ($_REQUEST['type']) {
case 'artist':
case 'album':
- foreach ($data as $value) {
- $songs = $value->get_songs();
- $media_ids = array_merge($media_ids,$songs);
- }
+ foreach ($data as $value) {
+ $songs = $value->get_songs();
+ $media_ids = array_merge($media_ids,$songs);
+ }
break;
case 'song':
- foreach ($data as $value) {
- $media_ids[] = $value->id;
- }
+ foreach ($data as $value) {
+ $media_ids[] = $value->id;
+ }
break;
} // end switch on type
break;
case 'single_song':
- $media_ids[] = array('song',scrub_in($_REQUEST['song_id']));
+ $media_ids[] = array('song',scrub_in($_REQUEST['song_id']));
break;
case 'your_popular_songs':
$media_ids = get_popular_songs($_REQUEST['limit'], 'your', $GLOBALS['user']->id);
@@ -112,25 +112,25 @@ switch ($_REQUEST['action']) {
$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());
+ case 'democratic':
+ $democratic = new Democratic($_REQUEST['democratic_id']);
+ $urls = array($democratic->play_url());
break;
- case 'download':
- $media_ids[] = array('song',scrub_in($_REQUEST['song_id']));
+ case 'download':
+ $media_ids[] = array('song',scrub_in($_REQUEST['song_id']));
default:
break;
} // end action switch
-/* Now that we've gathered the song information we decide what
+/* Now that we've gathered the song information we decide what
* we should do with it, this is a sensitive time for the song id's
* they don't know where they want to go.. let's help them out
*/
-switch ($_REQUEST['method']) {
+switch ($_REQUEST['method']) {
case 'download':
// Run the access check and exit if they are not allowed to download
- if (!Access::check_function('batch_download')) { access_denied(); exit; }
+ if (!Access::check_function('batch_download')) { access_denied(); exit; }
// Format the zip file
@@ -142,30 +142,30 @@ switch ($_REQUEST['method']) {
case 'stream':
default:
// See if we need a special streamtype
- switch ($_REQUEST['action']) {
- case 'download':
- $stream_type = 'download';
+ switch ($_REQUEST['action']) {
+ case 'download':
+ $stream_type = 'download';
break;
- case 'democratic':
+ case 'democratic':
// Don't let them loop it
- if (Config::get('play_type') == 'democratic') {
- Config::set('play_type','stream','1');
+ if (Config::get('play_type') == 'democratic') {
+ Config::set('play_type','stream','1');
}
default:
- if (Config::get('play_type') == 'stream') {
+ if (Config::get('play_type') == 'stream') {
$stream_type = Config::get('playlist_type');
- }
- else {
- $stream_type = Config::get('play_type');
- }
+ }
+ else {
+ $stream_type = Config::get('play_type');
+ }
break;
- }
+ }
/* Start the Stream */
debug_event('stream.php' , 'Stream Type: '.$stream_type.' Media IDs: '.$media_ids, '5');
$stream = new Stream($stream_type,$media_ids);
- $stream->add_urls($urls);
- $stream->start();
+ $stream->add_urls($urls);
+ $stream->start();
-} // end method switch
+} // end method switch
?>