diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2009-05-15 13:26:30 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2009-05-15 13:26:30 +0000 |
commit | 809a3fc72ff5829b683a9167d6230e5fa101b6d3 (patch) | |
tree | 59aa3baab20b18554980f937bbe026bcbd5ba4ce /lib/class/stream.class.php | |
parent | 4259d662decc9f128519daf7b46d975bd72f5320 (diff) | |
download | ampache-809a3fc72ff5829b683a9167d6230e5fa101b6d3.tar.gz ampache-809a3fc72ff5829b683a9167d6230e5fa101b6d3.tar.bz2 ampache-809a3fc72ff5829b683a9167d6230e5fa101b6d3.zip |
add download for video that does not work, and most likely break song downloads \o/
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 |