mirror of
https://github.com/Yetangitu/ampache
synced 2025-10-03 17:59:21 +02:00
Fix broken API method
Api::search_songs needed to declare a type, and Search::run needed to honour that declaration.
This commit is contained in:
parent
6fd6cc1fcc
commit
1e05bfe554
3 changed files with 16 additions and 1 deletions
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
--------------------------------------------------------------------------
|
--------------------------------------------------------------------------
|
||||||
v.3.6-Alpha2
|
v.3.6-Alpha2
|
||||||
|
- Fixed search_songs API method to use Search::run properly
|
||||||
- Fixed require_session when auth_type is 'local'
|
- Fixed require_session when auth_type is 'local'
|
||||||
- Catalog filtering fix
|
- Catalog filtering fix
|
||||||
- Toggle artwork with a button instead of a checkbox (patch from mywindow)
|
- Toggle artwork with a button instead of a checkbox (patch from mywindow)
|
||||||
|
|
|
@ -581,6 +581,7 @@ class Api {
|
||||||
* This searches the songs and returns... songs
|
* This searches the songs and returns... songs
|
||||||
*/
|
*/
|
||||||
public static function search_songs($input) {
|
public static function search_songs($input) {
|
||||||
|
$array['type'] = 'song';
|
||||||
$array['rule_1'] = 'anywhere';
|
$array['rule_1'] = 'anywhere';
|
||||||
$array['rule_1_input'] = $input['filter'];
|
$array['rule_1_input'] = $input['filter'];
|
||||||
$array['rule_1_operator'] = 0;
|
$array['rule_1_operator'] = 0;
|
||||||
|
|
|
@ -462,6 +462,19 @@ class Search extends playlist_object {
|
||||||
break;
|
break;
|
||||||
} // end switcn on operator
|
} // 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;
|
return $request;
|
||||||
} // end clean_request
|
} // end clean_request
|
||||||
|
|
||||||
|
@ -504,7 +517,7 @@ class Search extends playlist_object {
|
||||||
/* Create an array of the object we need to search on */
|
/* Create an array of the object we need to search on */
|
||||||
$data = Search::clean_request($data);
|
$data = Search::clean_request($data);
|
||||||
|
|
||||||
$search = new Search($_REQUEST['type']);
|
$search = new Search($data['type']);
|
||||||
$search->parse_rules($data);
|
$search->parse_rules($data);
|
||||||
|
|
||||||
/* Generate BASE SQL */
|
/* Generate BASE SQL */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue