summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-11-13 16:26:20 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-11-13 16:26:20 +0000
commit868f2b2a2029ea3453e6ef219c96e8bfeb6097e7 (patch)
tree5959738de12d7740e0210c541c7706d1fb5685c1
parent70c2fedd2992bc2bf5309a9afcc8b810aa7f80ce (diff)
downloadampache-868f2b2a2029ea3453e6ef219c96e8bfeb6097e7.tar.gz
ampache-868f2b2a2029ea3453e6ef219c96e8bfeb6097e7.tar.bz2
ampache-868f2b2a2029ea3453e6ef219c96e8bfeb6097e7.zip
fixed parse error if no localplay type is selected
-rw-r--r--lib/localplay.lib.php7
-rw-r--r--modules/localplay/mpd.controller.php2
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/localplay.lib.php b/lib/localplay.lib.php
index 72807e91..fb98d3fb 100644
--- a/lib/localplay.lib.php
+++ b/lib/localplay.lib.php
@@ -5,9 +5,8 @@
All Rights Reserved
This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2
- of the License, or (at your option) any later version.
+ modify it under the terms of the GNU General Public License v2
+ as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -183,6 +182,8 @@ function init_localplay($reload=0) {
static $localplay;
if ($GLOBALS['user']->prefs['localplay_level'] == '0') { return false; }
+ if (!strlen($GLOBALS['user']->prefs['localplay_controller'])) { return false; }
+
if ($GLOBALS['user']->prefs['localplay_level'] == '1' AND !is_object($localplay)) {
$localplay = new Localplay(conf('localplay_controller'));
$localplay->connect();
diff --git a/modules/localplay/mpd.controller.php b/modules/localplay/mpd.controller.php
index 46ea9951..b81b6a95 100644
--- a/modules/localplay/mpd.controller.php
+++ b/modules/localplay/mpd.controller.php
@@ -109,6 +109,8 @@ class AmpacheMpd {
* and then add them to MPD
*/
function add_songs($songs) {
+ /* Clear the playlist first */
+ $this->clean_playlist();
foreach ($songs as $song_id) {
$song = new Song($song_id);