summaryrefslogtreecommitdiffstats
path: root/lib/class/stream.class.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-12-05 20:53:41 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-12-05 20:53:41 +0000
commitf7cfd87117fbd41911bb6823aec8ea3ffdd72350 (patch)
tree846ae867a116347abe5c0a1a3183c31169df73f6 /lib/class/stream.class.php
parent52d3da75d2c8624191d484899846af00d3689634 (diff)
downloadampache-f7cfd87117fbd41911bb6823aec8ea3ffdd72350.tar.gz
ampache-f7cfd87117fbd41911bb6823aec8ea3ffdd72350.tar.bz2
ampache-f7cfd87117fbd41911bb6823aec8ea3ffdd72350.zip
fixed problem with invalid urls being sent to mpd in some cases
Diffstat (limited to 'lib/class/stream.class.php')
-rw-r--r--lib/class/stream.class.php19
1 files changed, 8 insertions, 11 deletions
diff --git a/lib/class/stream.class.php b/lib/class/stream.class.php
index 3b5d24cb..faadd2b2 100644
--- a/lib/class/stream.class.php
+++ b/lib/class/stream.class.php
@@ -451,17 +451,14 @@ class Stream {
//HACK!!!
// Yea.. you know the baby jesus... he's crying right meow
foreach ($this->songs as $song_id) {
- $this->objects[] = new Song($song_id);
- }
-
-
- // Foreach the stuff we've got and add it
- foreach ($this->objects as $object) {
- $localplay->add($object);
- }
-
- foreach ($this->urls as $url) {
- $localplay->add($url);
+ if ($song_id > 0) {
+ $song = new Song($song_id);
+ $localplay->add($song);
+ }
+ else {
+ $url = array_shift($this->urls);
+ $localplay->add($url);
+ }
}
$localplay->play();