restore compatibility with iOS and Android

master
Gilles Crettenand 11 years ago
parent b1abe9d446
commit 150d37b5ea

@ -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) {

Loading…
Cancel
Save