diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-07-24 04:10:58 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-07-24 04:10:58 +0000 |
commit | a74d0b7163c8755e23598997c364bc75a18f943e (patch) | |
tree | c1ad6ca02907d18b78542e79e557e93901afadf7 /lib/class/stream.class.php | |
parent | 0f9c1f245c35e533171cda4b433718f24ca8a707 (diff) | |
download | ampache-a74d0b7163c8755e23598997c364bc75a18f943e.tar.gz ampache-a74d0b7163c8755e23598997c364bc75a18f943e.tar.bz2 ampache-a74d0b7163c8755e23598997c364bc75a18f943e.zip |
added dynamic playlist item support, default and genre currently work
Diffstat (limited to 'lib/class/stream.class.php')
-rw-r--r-- | lib/class/stream.class.php | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/lib/class/stream.class.php b/lib/class/stream.class.php index cbfd026d..2f5c4aee 100644 --- a/lib/class/stream.class.php +++ b/lib/class/stream.class.php @@ -103,13 +103,21 @@ class Stream { header("Content-Disposition: filename=playlist.m3u"); header("Content-Type: audio/x-mpegurl;"); + // Flip for the poping! + asort($this->urls); + /* Foreach songs */ foreach ($this->songs as $song_id) { + // If it's a place-holder + if ($song_id == '-1') { + echo array_pop($this->urls) . "\n"; + continue; + } $song = new Song($song_id); if ($song->type == ".flac") { $song->type = ".ogg"; } - if($GLOBALS['user']->prefs['play_type'] == 'downsample') { - $ds = $GLOBALS['user']->prefs['sample_rate']; - } + if ($GLOBALS['user']->prefs['play_type'] == 'downsample') { + $ds = $GLOBALS['user']->prefs['sample_rate']; + } echo "$this->web_path/play/index.php?song=$song_id&uid=$this->user_id&sid=$this->sess&ds=$ds&stupidwinamp=." . $song->type . "\n"; } // end foreach @@ -133,8 +141,16 @@ class Stream { header("Content-Type: audio/x-mpegurl;"); echo "#EXTM3U\n"; + // Flip for the popping + asort($this->urls); + // Foreach the songs in this stream object foreach ($this->songs as $song_id) { + if ($song_id == '-1') { + echo "#EXTINF: URL-Add\n"; + echo array_pop($this->urls) . "\n"; + continue; + } $song = new Song($song_id); $song->format(); |