diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-08-19 07:34:11 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-08-19 07:34:11 +0000 |
commit | d560bb1c7b7e675ad72af0731df18757bf9d5700 (patch) | |
tree | 75bb0a543caecb8779280aadb84cf47c8066f94c | |
parent | f92b79ec098ad56690dce0c615a25dcac3955fba (diff) | |
download | ampache-d560bb1c7b7e675ad72af0731df18757bf9d5700.tar.gz ampache-d560bb1c7b7e675ad72af0731df18757bf9d5700.tar.bz2 ampache-d560bb1c7b7e675ad72af0731df18757bf9d5700.zip |
fixed single downloads and that annoying minor css issue with albums of the moment
-rw-r--r-- | admin/catalog.php | 4 | ||||
-rwxr-xr-x | docs/CHANGELOG | 2 | ||||
-rw-r--r-- | lib/class/stream.class.php | 21 | ||||
-rw-r--r-- | lib/init.php | 4 | ||||
-rw-r--r-- | stream.php | 13 | ||||
-rw-r--r-- | templates/show_song_row.inc.php | 2 |
6 files changed, 39 insertions, 7 deletions
diff --git a/admin/catalog.php b/admin/catalog.php index 34f63522..d65b2c76 100644 --- a/admin/catalog.php +++ b/admin/catalog.php @@ -43,6 +43,7 @@ switch ($_REQUEST['action']) { $catalog = new Catalog(); $_REQUEST['catalogs'] = $catalog->get_catalog_ids(); case 'add_to_catalog': + ob_end_flush(); if (Config::get('demo_mode')) { break; } if ($_REQUEST['catalogs'] ) { foreach ($_REQUEST['catalogs'] as $catalog_id) { @@ -58,6 +59,7 @@ switch ($_REQUEST['action']) { case 'update_all_catalogs': $_REQUEST['catalogs'] = Catalog::get_catalog_ids(); case 'update_catalog': + ob_end_flush(); /* If they are in demo mode stop here */ if (Config::get('demo_mode')) { break; } @@ -73,6 +75,7 @@ switch ($_REQUEST['action']) { show_confirmation($title,$body,$url); break; case 'full_service': + ob_end_flush(); $catalog = new Catalog(); /* Make sure they aren't in demo mode */ if (conf('demo_mode')) { break; } @@ -126,6 +129,7 @@ switch ($_REQUEST['action']) { $catalog = new Catalog(); $_REQUEST['catalogs'] = Catalog::get_catalog_ids(); case 'clean_catalog': + ob_end_flush(); /* If they are in demo mode stop them here */ if (Config::get('demo_mode')) { break; } diff --git a/docs/CHANGELOG b/docs/CHANGELOG index 156175dd..018c14d8 100755 --- a/docs/CHANGELOG +++ b/docs/CHANGELOG @@ -4,6 +4,8 @@ -------------------------------------------------------------------------- v.3.4-Alpha2 + - Fixed single downloads + - Fixed weird CSS issue with a crafty little hack - Fixed a session fixation issue - Fixed Album Disk support for OGG's and added display to browse albums diff --git a/lib/class/stream.class.php b/lib/class/stream.class.php index d13271dd..3f1b4166 100644 --- a/lib/class/stream.class.php +++ b/lib/class/stream.class.php @@ -468,6 +468,27 @@ class Stream { } // create_democratic /** + * create_download + * This prompts for a download of the song, only a single + * element can by in song_ids + */ + private function create_download() { + + // Build up our object + $song_id = $this->songs['0']; + $song = new Song($song_id); + $url = $song->get_url($this->session); + + // Append the fact we are downloading + $url .= '&action=download'; + + // Header redirect baby! + header("Location: $url"); + exit; + + } //create_download + + /** * create_ram *this functions creates a RAM file for use by Real Player */ diff --git a/lib/init.php b/lib/init.php index fdbabe45..147d2581 100644 --- a/lib/init.php +++ b/lib/init.php @@ -23,6 +23,10 @@ * DO NOT EDIT THIS FILE ***/ +// Use output buffering, this gains us a few things and +// fixes some CSS issues +ob_start(); + // Set the Error level manualy... I'm to lazy to fix notices error_reporting(E_ALL ^ E_NOTICE); @@ -153,6 +153,8 @@ switch ($_REQUEST['action']) { $options = array('limit' => $_REQUEST['random'], 'random_type' => $_REQUEST['random_type'],'size_limit'=>$_REQUEST['size_limit']); $song_ids = get_random_songs($options, $matchlist); break; + case 'download': + $song_ids[] = $_REQUEST['song_id']; default: break; } // end action switch @@ -175,16 +177,15 @@ switch ($_REQUEST['method']) { break; case 'stream': default: - $stream_type = Config::get('playlist_type'); - - /* For non-stream/downsample methos we need to so something else */ - switch ($GLOBALS['user']->prefs['play_type']) { - case 'stream': + // See if we need a special streamtype + switch ($_REQUEST['action']) { + case 'download': + $stream_type = 'download'; break; default: $stream_type = $GLOBALS['user']->prefs['play_type']; break; - } + } /* Start the Stream */ $stream = new Stream($stream_type,$song_ids); diff --git a/templates/show_song_row.inc.php b/templates/show_song_row.inc.php index 350e0874..3ae150ca 100644 --- a/templates/show_song_row.inc.php +++ b/templates/show_song_row.inc.php @@ -30,7 +30,7 @@ <td><?php echo $song->f_time; ?></td> <td> <?php if ($GLOBALS['user']->prefs['download']) { ?> - <a href="<?php echo Config::get('web_path'); ?>/play/index.php?action=download&uid=<?php echo $GLOBALS['user']->id; ?>&song=<?php echo $song->id; ?>&sid=<?php echo session_id(); ?>"> + <a href="<?php echo Config::get('web_path'); ?>/stream.php?action=download&song_id=<?php echo $song->id; ?>"> <?php echo get_user_icon('download',_('Download')); ?> </a> <?php } ?> |