From 868f2b2a2029ea3453e6ef219c96e8bfeb6097e7 Mon Sep 17 00:00:00 2001 From: Karl 'vollmerk' Vollmer Date: Mon, 13 Nov 2006 16:26:20 +0000 Subject: fixed parse error if no localplay type is selected --- lib/localplay.lib.php | 7 ++++--- modules/localplay/mpd.controller.php | 2 ++ 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); -- cgit