From 150d37b5ea4524b42ca21e10bfee5c51faae15f7 Mon Sep 17 00:00:00 2001 From: Gilles Crettenand Date: Fri, 29 May 2015 11:30:55 +0200 Subject: [PATCH] restore compatibility with iOS and Android --- mobile.netbiblio.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mobile.netbiblio.php b/mobile.netbiblio.php index b46ddc5..3d3e5b1 100644 --- a/mobile.netbiblio.php +++ b/mobile.netbiblio.php @@ -305,6 +305,12 @@ class NetBiblio extends WebService throw new WebException("CallArg", "Argument must be valid JSON.", -42); } + // The iOS and Android applications still uses 'category' instead of 'genre' + if(isset($queryArray['category']) && is_array($queryArray['category'])) { + $queryArray['genre'] = $queryArray['category']; + unset($queryArray['category']); + } + $bs = new BookSearch(); if (isset($queryArray['queryType'])) { @@ -370,6 +376,12 @@ class NetBiblio extends WebService return AudioBook::ListOfGenres(); } + public function ListOfCategories() + { + // this method exists for compatibility purpose with the Android and iOS applications + return $this->ListOfGenres(); + } + public function ListOfTypes() { return array_filter(AudioBook::listOfTypes(), function ($t) {