From 30b1143f9c0759922744a447875b860b3fe75868 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pauli=20J=C3=A4rvinen?= Date: Fri, 13 Oct 2023 23:07:53 +0300 Subject: [PATCH] Ampache API: Make `advanced_search` args `operator` and `type` optional 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. --- CHANGELOG.md | 1 + lib/Controller/AmpacheController.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 93a57fe1f..860cd59eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ### Added ### Changed +- Ampache API: Make `advanced_search` arguments `operator` and `type` optional ### Fixed diff --git a/lib/Controller/AmpacheController.php b/lib/Controller/AmpacheController.php index 5282c9dfc..82b0594ad 100644 --- a/lib/Controller/AmpacheController.php +++ b/lib/Controller/AmpacheController.php @@ -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());