summaryrefslogtreecommitdiffstats
path: root/modules/localplay/mpd.controller.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-01-01 22:34:12 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-01-01 22:34:12 +0000
commit6a0573d1fe8b12f1adacf3924de9808401f8e7b6 (patch)
tree17143ae90ed05facaf54e00825bc190bd20e21aa /modules/localplay/mpd.controller.php
parent850edbb1f20ce3cfd8be5f6fe93207ba9a56db3a (diff)
downloadampache-6a0573d1fe8b12f1adacf3924de9808401f8e7b6.tar.gz
ampache-6a0573d1fe8b12f1adacf3924de9808401f8e7b6.tar.bz2
ampache-6a0573d1fe8b12f1adacf3924de9808401f8e7b6.zip
slight tweak to the random album art, needs improvement will look funny on catalogs with no art (for now) editing an mpd instance works, need to fix httpq editing and add instance testing
Diffstat (limited to 'modules/localplay/mpd.controller.php')
-rw-r--r--modules/localplay/mpd.controller.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/modules/localplay/mpd.controller.php b/modules/localplay/mpd.controller.php
index 7fe5b778..90a1e9a7 100644
--- a/modules/localplay/mpd.controller.php
+++ b/modules/localplay/mpd.controller.php
@@ -204,6 +204,25 @@ class AmpacheMpd extends localplay_controller {
} // get_instance
/**
+ * update_instance
+ * This takes an ID and an array of data and updates the instance specified
+ */
+ public function update_instance($uid,$data) {
+
+ $uid = Dba::escape($uid);
+ $host = $data['host'] ? Dba::escape($data['host']) : '127.0.0.1';
+ $port = $data['port'] ? Dba::escape($data['port']) : '6600';
+ $name = Dba::escape($data['name']);
+ $pass = Dba::escape($data['password']);
+
+ $sql = "UPDATE `localplay_mpd` SET `host`='$host', `port`='$port', `name`='$name', `password`='$pass' WHERE `id`='$uid'";
+ $db_results = Dba::query($sql);
+
+ return true;
+
+ } // update_instance
+
+ /**
* instance_fields
* This returns a key'd array of [NAME]=>array([DESCRIPTION]=>VALUE,[TYPE]=>VALUE) for the
* fields so that we can on-the-fly generate a form