From f7cfd87117fbd41911bb6823aec8ea3ffdd72350 Mon Sep 17 00:00:00 2001 From: Karl 'vollmerk' Vollmer Date: Wed, 5 Dec 2007 20:53:41 +0000 Subject: fixed problem with invalid urls being sent to mpd in some cases --- docs/CHANGELOG | 2 ++ lib/class/stream.class.php | 19 ++++++++----------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/docs/CHANGELOG b/docs/CHANGELOG index d94002ec..c0ae3b74 100755 --- a/docs/CHANGELOG +++ b/docs/CHANGELOG @@ -4,6 +4,8 @@ -------------------------------------------------------------------------- v.3.4-Alpha4 + - Fixed problem with invalid urls populated to localplay methods + under certin conditions - Fixed Album Art dump bin script - Added paging to the Playlist Song view - Fixed error on catalog Update All 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(); -- cgit