summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-09-28 04:34:02 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-09-28 04:34:02 +0000
commit79ca59df627660d635a9373bfeb293592c173793 (patch)
treedee673409ee084f47f2121ff049f2bdd859fb057 /modules
parent705fba8f49faa42ed7f004f67b74a996c29ddb3d (diff)
downloadampache-79ca59df627660d635a9373bfeb293592c173793.tar.gz
ampache-79ca59df627660d635a9373bfeb293592c173793.tar.bz2
ampache-79ca59df627660d635a9373bfeb293592c173793.zip
fixed some localplay issues, now correctly shows the active instance at least for the MPD module
Diffstat (limited to 'modules')
-rw-r--r--modules/localplay/mpd.controller.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/modules/localplay/mpd.controller.php b/modules/localplay/mpd.controller.php
index afdd4442..4b3c953f 100644
--- a/modules/localplay/mpd.controller.php
+++ b/modules/localplay/mpd.controller.php
@@ -180,9 +180,11 @@ class AmpacheMpd extends localplay_controller {
/**
* get_instance
* This returns the specified instance and all it's pretty variables
+ * If no instance is passed current is used
*/
- private function get_instance($instance) {
+ public function get_instance($instance='') {
+ $instance = $instance ? $instance : $GLOBALS['user']->prefs['mpd_active'];
$instance = Dba::escape($instance);
$sql = "SELECT * FROM `localplay_mpd` WHERE `id`='$instance'";
@@ -223,7 +225,7 @@ class AmpacheMpd extends localplay_controller {
$user_id = $user_id ? $user_id : $GLOBALS['user']->id;
- Preference::update('mpd_instance',$user_id,intval($uid));
+ Preference::update('mpd_active',$user_id,intval($uid));
return true;
@@ -522,7 +524,7 @@ class AmpacheMpd extends localplay_controller {
public function connect() {
// Look at the current instance and pull the options for said instance
- $options = self::get_instance($GLOBALS['user']->prefs['mpd_active']);
+ $options = self::get_instance();
$this->_mpd = new mpd($options['host'],$options['port'],$options['password']);
if ($this->_mpd->connected) { return true; }