diff options
Diffstat (limited to 'lib/class/stream.class.php')
-rw-r--r-- | lib/class/stream.class.php | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/lib/class/stream.class.php b/lib/class/stream.class.php index 8b298917..0384a991 100644 --- a/lib/class/stream.class.php +++ b/lib/class/stream.class.php @@ -554,16 +554,19 @@ class Stream { */ private function create_download() { - // Build up our object - $song_id = $this->media['0']; - $url = Song::play_url($song_id); - - // Append the fact we are downloading - $url .= '&action=download'; + // There should only be one here... + foreach ($this->media as $element) { + $type = array_shift($element); + $media = new $type(array_shift($element)); + $url = call_user_func(array($type,'play_url'),$media->id); + + // Append the fact we are downloading + $url .= '&action=download'; - // Header redirect baby! - header("Location: $url"); - exit; + // Header redirect baby! + header("Location: $url"); + exit; + } } //create_download |