From 809a3fc72ff5829b683a9167d6230e5fa101b6d3 Mon Sep 17 00:00:00 2001 From: Karl 'vollmerk' Vollmer Date: Fri, 15 May 2009 13:26:30 +0000 Subject: add download for video that does not work, and most likely break song downloads \o/ --- lib/class/stream.class.php | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'lib/class/stream.class.php') 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 -- cgit