diff --git a/base.php b/base.php index a3ccdad..46b7a77 100644 --- a/base.php +++ b/base.php @@ -723,7 +723,7 @@ class PageQueryResult extends Page $this->entryArray = Author::getAuthorsByStartingLetter ('%' . $this->query); break; case self::SCOPE_TAG : - $this->entryArray = Tag::getAllTagsByQuery ($this->query); + list ($this->entryArray, $this->totalNumber) = Tag::getAllTagsByQuery ($this->query, -1); break; case self::SCOPE_SERIES : $this->entryArray = Serie::getAllSeriesByQuery ($this->query); diff --git a/book.php b/book.php index 7cc1b9c..d20db17 100644 --- a/book.php +++ b/book.php @@ -591,9 +591,10 @@ function getJson ($complete = false) { $out = array (); $pagequery = Base::PAGE_OPENSEARCH_QUERY; + // Special case when no databases were chosen, we search on all databases if (is_array ($config['calibre_directory']) && $multi === "1") { $i = 0; - foreach ($config['calibre_directory'] as $key => $value) { + foreach (array_keys ($config['calibre_directory']) as $key) { Base::clearDb (); array_push ($out, array ("title" => $key, "class" => "tt-header",