summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xdocs/CHANGELOG1
-rw-r--r--lib/class/api.class.php1
-rw-r--r--lib/class/search.class.php15
3 files changed, 16 insertions, 1 deletions
diff --git a/docs/CHANGELOG b/docs/CHANGELOG
index 6ee0f3f8..38b6267f 100755
--- a/docs/CHANGELOG
+++ b/docs/CHANGELOG
@@ -4,6 +4,7 @@
--------------------------------------------------------------------------
v.3.6-Alpha2
+ - Fixed search_songs API method to use Search::run properly
- Fixed require_session when auth_type is 'local'
- Catalog filtering fix
- Toggle artwork with a button instead of a checkbox (patch from mywindow)
diff --git a/lib/class/api.class.php b/lib/class/api.class.php
index 631308eb..91433437 100644
--- a/lib/class/api.class.php
+++ b/lib/class/api.class.php
@@ -581,6 +581,7 @@ class Api {
* This searches the songs and returns... songs
*/
public static function search_songs($input) {
+ $array['type'] = 'song';
$array['rule_1'] = 'anywhere';
$array['rule_1_input'] = $input['filter'];
$array['rule_1_operator'] = 0;
diff --git a/lib/class/search.class.php b/lib/class/search.class.php
index f2c3cee9..cdb9422e 100644
--- a/lib/class/search.class.php
+++ b/lib/class/search.class.php
@@ -461,6 +461,19 @@ class Search extends playlist_object {
$request['operator'] = 'AND';
break;
} // end switcn on operator
+
+ // Verify the type
+ switch($data['type']) {
+ case 'album':
+ case 'artist':
+ case 'video':
+ case 'song':
+ $request['type'] = $data['type'];
+ break;
+ default:
+ $request['type'] = 'song';
+ break;
+ }
return $request;
} // end clean_request
@@ -504,7 +517,7 @@ class Search extends playlist_object {
/* Create an array of the object we need to search on */
$data = Search::clean_request($data);
- $search = new Search($_REQUEST['type']);
+ $search = new Search($data['type']);
$search->parse_rules($data);
/* Generate BASE SQL */