From 5aeac3b17e31d0cc88321a614469c4f3f1a9c0dc Mon Sep 17 00:00:00 2001 From: Karl 'vollmerk' Vollmer Date: Sun, 9 Apr 2006 07:55:50 +0000 Subject: added an ugly localplay view page, and made it so you can remove songs from your mpd playlist... its ugly.. I know.. ooh yea you can also deactivate modules now --- lib/class/localplay.class.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'lib/class') diff --git a/lib/class/localplay.class.php b/lib/class/localplay.class.php index 232e9158..1cc9eccb 100644 --- a/lib/class/localplay.class.php +++ b/lib/class/localplay.class.php @@ -137,6 +137,7 @@ class Localplay { $this->_function_map['volume_set'] = $data['volume_set']; $this->_function_map['volume_up'] = $data['volume_up']; $this->_function_map['volume_down'] = $data['volume_down']; + $this->_function_map['delete_all'] = $data['delete_all']; } // _map_functions @@ -241,6 +242,8 @@ class Localplay { * get * This calls the get function of the player and then returns * the array of current songs for display or whatever + * Null is returned on failure here because the PHP count() + * function will return 1 on a value of 'false' */ function get() { @@ -248,9 +251,9 @@ class Localplay { $data = $this->_player->$function(); - if (!count($data)) { + if (!count($data) OR !is_array($data)) { debug_event('localplay','Error Unable to get song info, check ' . $this->type . ' controller','1'); - return false; + return NULL; } return $data; @@ -312,7 +315,15 @@ class Localplay { */ function delete($songs) { + $function = $this->_function_map['delete']; + + if (!$this->_player->$function($songs)) { + debug_event('localplay','Error: Unable to remove songs, check ' . $this->type . ' controller','1'); + return false; + } + + return true; } // delete -- cgit