Skip to content

Commit

Permalink
Ampache API: Make advanced_search args operator and type optional
Browse files Browse the repository at this point in the history
The `operator` now defaults to 'and' and `type` to 'song'. The API
specification defines these arguments as required but the changed
behavior matches the actual implementation of the genuine Ampache
server. At least the Foam client relies on this behavior.
  • Loading branch information
paulijar committed Oct 13, 2023
1 parent b5e8954 commit 30b1143
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### Added

### Changed
- Ampache API: Make `advanced_search` arguments `operator` and `type` optional

### Fixed

Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/AmpacheController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,7 @@ protected function bookmark_delete(int $filter, string $type) : array {
/**
* @AmpacheAPI
*/
protected function advanced_search(string $type, string $operator, int $limit, int $offset=0, bool $random=false) : array {
protected function advanced_search(int $limit, int $offset=0, string $type='song', string $operator='and', bool $random=false) : array {
// get all the rule parameters as passed on the HTTP call
$rules = self::advSearchGetRuleParams($this->request->getParams());

Expand Down

0 comments on commit 30b1143

Please sign in to comment.