summaryrefslogtreecommitdiffstats
path: root/modules/localplay/mpd.controller.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-09-09 22:17:13 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-09-09 22:17:13 +0000
commitf89098d3ac6ea2045f34c586d1433ca40e6df9c7 (patch)
treef382e112dae91b392a38671f81c9a798766f1505 /modules/localplay/mpd.controller.php
parentb1b7998a0f9a6438725fb574e63e27859a6bd2e6 (diff)
downloadampache-f89098d3ac6ea2045f34c586d1433ca40e6df9c7.tar.gz
ampache-f89098d3ac6ea2045f34c586d1433ca40e6df9c7.tar.bz2
ampache-f89098d3ac6ea2045f34c586d1433ca40e6df9c7.zip
few more tweaks to localplay, added in the mpd table creation mojo, just need to finish install and then build the interface
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 8e067960..1ca7b4f5 100644
--- a/modules/localplay/mpd.controller.php
+++ b/modules/localplay/mpd.controller.php
@@ -109,6 +109,10 @@ class AmpacheMpd extends localplay_controller {
*/
public function is_installed() {
+ $sql = "DESCRIBE `localplay_mpd`";
+ $db_results = Dba::query($sql);
+
+ return Dba::num_rows($db_results);
} // is_installed
@@ -118,7 +122,18 @@ class AmpacheMpd extends localplay_controller {
*/
public function install() {
+ /* We need to create the MPD table */
+ $sql = "CREATE TABLE `localplay_mpd` ( `id` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY , " .
+ "`name` VARCHAR( 128 ) NOT NULL , " .
+ "`owner` INT( 11 ) NOT NULL , " .
+ "`host` VARCHAR( 255 ) NOT NULL , " .
+ "`port` INT( 11 ) UNSIGNED NOT NULL DEFAULT '6600', " .
+ "`password` VARCHAR( 255 ) NOT NULL , " .
+ "`access` SMALLINT( 4 ) UNSIGNED NOT NULL DEFAULT '0' " .
+ ") ENGINE = MYISAM";
+ $db_results = Dba::query($sql);
+ return true;
} // install
@@ -128,6 +143,10 @@ class AmpacheMpd extends localplay_controller {
*/
public function uninstall() {
+ $sql = "DROP TABLE `localplay_mpd`";
+ $db_results = Dba::query($sql);
+
+ return true;
} // uninstall